Class: OCI::FleetAppsManagement::Models::ComplianceReportResource

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/fleet_apps_management/models/compliance_report_resource.rb

Overview

Details of the Resource

Constant Summary collapse

COMPLIANCE_STATE_ENUM =
[
  COMPLIANCE_STATE_UNKNOWN = 'UNKNOWN'.freeze,
  COMPLIANCE_STATE_COMPLIANT = 'COMPLIANT'.freeze,
  COMPLIANCE_STATE_NON_COMPLIANT = 'NON_COMPLIANT'.freeze,
  COMPLIANCE_STATE_WARNING = 'WARNING'.freeze,
  COMPLIANCE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ComplianceReportResource

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 107

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId']

  raise 'You cannot provide both :resourceId and :resource_id' if attributes.key?(:'resourceId') && attributes.key?(:'resource_id')

  self.resource_id = attributes[:'resource_id'] if attributes[:'resource_id']

  self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName']

  raise 'You cannot provide both :resourceName and :resource_name' if attributes.key?(:'resourceName') && attributes.key?(:'resource_name')

  self.resource_name = attributes[:'resource_name'] if attributes[:'resource_name']

  self.resource_type = attributes[:'resourceType'] if attributes[:'resourceType']

  raise 'You cannot provide both :resourceType and :resource_type' if attributes.key?(:'resourceType') && attributes.key?(:'resource_type')

  self.resource_type = attributes[:'resource_type'] if attributes[:'resource_type']

  self.tenancy_id = attributes[:'tenancyId'] if attributes[:'tenancyId']

  raise 'You cannot provide both :tenancyId and :tenancy_id' if attributes.key?(:'tenancyId') && attributes.key?(:'tenancy_id')

  self.tenancy_id = attributes[:'tenancy_id'] if attributes[:'tenancy_id']

  self.tenancy_name = attributes[:'tenancyName'] if attributes[:'tenancyName']

  raise 'You cannot provide both :tenancyName and :tenancy_name' if attributes.key?(:'tenancyName') && attributes.key?(:'tenancy_name')

  self.tenancy_name = attributes[:'tenancy_name'] if attributes[:'tenancy_name']

  self.compartment = attributes[:'compartment'] if attributes[:'compartment']

  self.resource_region = attributes[:'resourceRegion'] if attributes[:'resourceRegion']

  raise 'You cannot provide both :resourceRegion and :resource_region' if attributes.key?(:'resourceRegion') && attributes.key?(:'resource_region')

  self.resource_region = attributes[:'resource_region'] if attributes[:'resource_region']

  self.compliance_state = attributes[:'complianceState'] if attributes[:'complianceState']

  raise 'You cannot provide both :complianceState and :compliance_state' if attributes.key?(:'complianceState') && attributes.key?(:'compliance_state')

  self.compliance_state = attributes[:'compliance_state'] if attributes[:'compliance_state']

  self.products = attributes[:'products'] if attributes[:'products']
end

Instance Attribute Details

#compartmentString

Compartment the resource belongs to.

Returns:

  • (String)


42
43
44
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 42

def compartment
  @compartment
end

#compliance_stateString

[Required] The last known compliance state of the fleet.

Returns:

  • (String)


50
51
52
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 50

def compliance_state
  @compliance_state
end

#productsArray<OCI::FleetAppsManagement::Models::ComplianceReportProduct>

Products associated with the Fleet. Only the products belonging to managed targets will be shown.



56
57
58
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 56

def products
  @products
end

#resource_idString

[Required] The OCID to identify the resource.

Returns:

  • (String)


22
23
24
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 22

def resource_id
  @resource_id
end

#resource_nameString

[Required] Display name of the resource.

Returns:

  • (String)


26
27
28
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 26

def resource_name
  @resource_name
end

#resource_regionString

The region the resource belongs to.

Returns:

  • (String)


46
47
48
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 46

def resource_region
  @resource_region
end

#resource_typeString

[Required] Type of the resource.

Returns:

  • (String)


30
31
32
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 30

def resource_type
  @resource_type
end

#tenancy_idString

TenancyId of the resource.

Returns:

  • (String)


34
35
36
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 34

def tenancy_id
  @tenancy_id
end

#tenancy_nameString

Tenancy the resource belongs to.

Returns:

  • (String)


38
39
40
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 38

def tenancy_name
  @tenancy_name
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 59

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'resource_id': :'resourceId',
    'resource_name': :'resourceName',
    'resource_type': :'resourceType',
    'tenancy_id': :'tenancyId',
    'tenancy_name': :'tenancyName',
    'compartment': :'compartment',
    'resource_region': :'resourceRegion',
    'compliance_state': :'complianceState',
    'products': :'products'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 76

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'resource_id': :'String',
    'resource_name': :'String',
    'resource_type': :'String',
    'tenancy_id': :'String',
    'tenancy_name': :'String',
    'compartment': :'String',
    'resource_region': :'String',
    'compliance_state': :'String',
    'products': :'Array<OCI::FleetAppsManagement::Models::ComplianceReportProduct>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 180

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    resource_id == other.resource_id &&
    resource_name == other.resource_name &&
    resource_type == other.resource_type &&
    tenancy_id == other.tenancy_id &&
    tenancy_name == other.tenancy_name &&
    compartment == other.compartment &&
    resource_region == other.resource_region &&
    compliance_state == other.compliance_state &&
    products == other.products
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 218

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


198
199
200
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 198

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



207
208
209
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 207

def hash
  [resource_id, resource_name, resource_type, tenancy_id, tenancy_name, compartment, resource_region, compliance_state, products].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



251
252
253
254
255
256
257
258
259
260
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 251

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



245
246
247
# File 'lib/oci/fleet_apps_management/models/compliance_report_resource.rb', line 245

def to_s
  to_hash.to_s
end