Class: OCI::FleetAppsManagement::Models::FleetResource

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

Overview

Resource added to a fleet in Fleet Application Management.

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
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_NEEDS_ATTENTION = 'NEEDS_ATTENTION'.freeze,
  LIFECYCLE_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 = {}) ⇒ FleetResource

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :tenancy_id (String)

    The value to assign to the #tenancy_id property

  • :resource_region (String)

    The value to assign to the #resource_region property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :resource_id (String)

    The value to assign to the #resource_id property

  • :compartment (String)

    The value to assign to the #compartment property

  • :compliance_state (String)

    The value to assign to the #compliance_state property

  • :percent_compliant (Float)

    The value to assign to the #percent_compliant property

  • :tenancy_name (String)

    The value to assign to the #tenancy_name property

  • :resource_type (String)

    The value to assign to the #resource_type property

  • :product_count (Integer)

    The value to assign to the #product_count property

  • :target_count (Integer)

    The value to assign to the #target_count property

  • :product (String)

    The value to assign to the #product property

  • :environment_type (String)

    The value to assign to the #environment_type property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :lifecycle_details (String)

    The value to assign to the #lifecycle_details property

  • :system_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #system_tags property



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 200

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.id = attributes[:'id'] if attributes[:'id']

  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.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.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  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.compartment = attributes[:'compartment'] if attributes[:'compartment']

  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.percent_compliant = attributes[:'percentCompliant'] if attributes[:'percentCompliant']

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

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

  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.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.product_count = attributes[:'productCount'] if attributes[:'productCount']

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

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

  self.target_count = attributes[:'targetCount'] if attributes[:'targetCount']

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

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

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

  self.environment_type = attributes[:'environmentType'] if attributes[:'environmentType']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

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

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

Instance Attribute Details

#compartmentString

Resource Compartment name.

Returns:

  • (String)


66
67
68
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 66

def compartment
  @compartment
end

#compartment_idString

[Required] OCID of the compartment to which the resource belongs to.

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#compliance_stateString

Compliance State of the Resource.

Returns:

  • (String)


70
71
72
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 70

def compliance_state
  @compliance_state
end

#display_nameString

[Required] A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Example: My new resource

Returns:

  • (String)


58
59
60
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 58

def display_name
  @display_name
end

#environment_typeString

Environment Type associated with the Fleet when the resource type is fleet. Will only be returned for ENVIRONMENT fleets that are part of a GROUP Fleet.

Returns:

  • (String)


102
103
104
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 102

def environment_type
  @environment_type
end

#idString

[Required] The unique id of the resource.

Returns:

  • (String)


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

def id
  @id
end

#lifecycle_detailsString

A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.

Returns:

  • (String)


110
111
112
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 110

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The current state of the FleetResource.

Returns:

  • (String)


106
107
108
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 106

def lifecycle_state
  @lifecycle_state
end

#percent_compliantFloat

The compliance percentage.

Returns:

  • (Float)


74
75
76
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 74

def percent_compliant
  @percent_compliant
end

#productString

Product associated with the resource when the resource type is fleet. Will only be returned for PRODUCT fleets that are part of a GROUP Fleet.

Returns:

  • (String)


96
97
98
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 96

def product
  @product
end

#product_countInteger

Count of products within the resource.

Returns:

  • (Integer)


86
87
88
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 86

def product_count
  @product_count
end

#resource_idString

[Required] The OCID of the resource.

Returns:

  • (String)


62
63
64
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 62

def resource_id
  @resource_id
end

#resource_regionString

Associated region

Returns:

  • (String)


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

def resource_region
  @resource_region
end

#resource_typeString

[Required] Type of the Resource.

Returns:

  • (String)


82
83
84
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 82

def resource_type
  @resource_type
end

#system_tagsHash<String, Hash<String, Object>>

System tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


116
117
118
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 116

def system_tags
  @system_tags
end

#target_countInteger

Count of targets within the resource.

Returns:

  • (Integer)


90
91
92
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 90

def target_count
  @target_count
end

#tenancy_idString

[Required] OCID of the tenancy to which the resource belongs to.

Returns:

  • (String)


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

def tenancy_id
  @tenancy_id
end

#tenancy_nameString

Resource Tenancy Name.

Returns:

  • (String)


78
79
80
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 78

def tenancy_name
  @tenancy_name
end

#time_createdDateTime

[Required] The time this resource was created. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

#time_updatedDateTime

The time this resource was last updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


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

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 119

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'tenancy_id': :'tenancyId',
    'resource_region': :'resourceRegion',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'compartment_id': :'compartmentId',
    'display_name': :'displayName',
    'resource_id': :'resourceId',
    'compartment': :'compartment',
    'compliance_state': :'complianceState',
    'percent_compliant': :'percentCompliant',
    'tenancy_name': :'tenancyName',
    'resource_type': :'resourceType',
    'product_count': :'productCount',
    'target_count': :'targetCount',
    'product': :'product',
    'environment_type': :'environmentType',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 147

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'tenancy_id': :'String',
    'resource_region': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'compartment_id': :'String',
    'display_name': :'String',
    'resource_id': :'String',
    'compartment': :'String',
    'compliance_state': :'String',
    'percent_compliant': :'Float',
    'tenancy_name': :'String',
    'resource_type': :'String',
    'product_count': :'Integer',
    'target_count': :'Integer',
    'product': :'String',
    'environment_type': :'String',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'system_tags': :'Hash<String, Hash<String, Object>>'
    # 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



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 348

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

  self.class == other.class &&
    id == other.id &&
    tenancy_id == other.tenancy_id &&
    resource_region == other.resource_region &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    compartment_id == other.compartment_id &&
    display_name == other.display_name &&
    resource_id == other.resource_id &&
    compartment == other.compartment &&
    compliance_state == other.compliance_state &&
    percent_compliant == other.percent_compliant &&
    tenancy_name == other.tenancy_name &&
    resource_type == other.resource_type &&
    product_count == other.product_count &&
    target_count == other.target_count &&
    product == other.product &&
    environment_type == other.environment_type &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    system_tags == other.system_tags
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



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 397

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


377
378
379
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 377

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



386
387
388
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 386

def hash
  [id, tenancy_id, resource_region, time_created, time_updated, compartment_id, display_name, resource_id, compartment, compliance_state, percent_compliant, tenancy_name, resource_type, product_count, target_count, product, environment_type, lifecycle_state, lifecycle_details, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



430
431
432
433
434
435
436
437
438
439
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 430

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



424
425
426
# File 'lib/oci/fleet_apps_management/models/fleet_resource.rb', line 424

def to_s
  to_hash.to_s
end