Class: OCI::ResourceAnalytics::Models::TenancyAttachment

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/resource_analytics/models/tenancy_attachment.rb

Overview

A TenancyAttachment is a customers' tenancy attached to a ResourceAnalyticsInstance. Attached tenancies will be included in analytics collection.

To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies.

Constant Summary collapse

DATA_POPULATION_STATUS_ENUM =
[
  DATA_POPULATION_STATUS_ACCEPTED = 'ACCEPTED'.freeze,
  DATA_POPULATION_STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  DATA_POPULATION_STATUS_WAITING = 'WAITING'.freeze,
  DATA_POPULATION_STATUS_FAILED = 'FAILED'.freeze,
  DATA_POPULATION_STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  DATA_POPULATION_STATUS_CANCELING = 'CANCELING'.freeze,
  DATA_POPULATION_STATUS_CANCELED = 'CANCELED'.freeze,
  DATA_POPULATION_STATUS_NEEDS_ATTENTION = 'NEEDS_ATTENTION'.freeze,
  DATA_POPULATION_STATUS_PARTIALLY_SUCCEEDED = 'PARTIALLY_SUCCEEDED'.freeze,
  DATA_POPULATION_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_NEEDS_ATTENTION = 'NEEDS_ATTENTION'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.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 = {}) ⇒ TenancyAttachment

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
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
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 178

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

  self.resource_analytics_instance_id = attributes[:'resourceAnalyticsInstanceId'] if attributes[:'resourceAnalyticsInstanceId']

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

  self.resource_analytics_instance_id = attributes[:'resource_analytics_instance_id'] if attributes[:'resource_analytics_instance_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.is_reporting_tenancy = attributes[:'isReportingTenancy'] unless attributes[:'isReportingTenancy'].nil?

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

  self.is_reporting_tenancy = attributes[:'is_reporting_tenancy'] unless attributes[:'is_reporting_tenancy'].nil?

  self.monitored_regions = attributes[:'monitoredRegions'] if attributes[:'monitoredRegions']

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

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

  self.data_population_status = attributes[:'dataPopulationStatus'] if attributes[:'dataPopulationStatus']

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

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

  self.time_data_population_started = attributes[:'timeDataPopulationStarted'] if attributes[:'timeDataPopulationStarted']

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

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

  self.time_data_population_ended = attributes[:'timeDataPopulationEnded'] if attributes[:'timeDataPopulationEnded']

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

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

  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.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

#data_population_statusString

[Required] The overall status of the data population from the tenancy.

Returns:

  • (String)


67
68
69
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 67

def data_population_status
  @data_population_status
end

#descriptionString

A description of the tenancy.

Returns:

  • (String)


47
48
49
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 47

def description
  @description
end

#idString

[Required] The OCID of the TenancyAttachment.

Returns:

  • (String)


43
44
45
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 43

def id
  @id
end

#is_reporting_tenancyBOOLEAN

[Required] Whether the tenancy is the tenancy used when creating Resource Analytics Instance.

Returns:

  • (BOOLEAN)


59
60
61
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 59

def is_reporting_tenancy
  @is_reporting_tenancy
end

#lifecycle_detailsString

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

Returns:

  • (String)


105
106
107
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 105

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The current state of the TenancyAttachment.

Returns:

  • (String)


99
100
101
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 99

def lifecycle_state
  @lifecycle_state
end

#monitored_regionsArray<OCI::ResourceAnalytics::Models::TenancyAttachmentMonitoredRegionSummary>

[Required] List of monitored regions with their data population status.



63
64
65
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 63

def monitored_regions
  @monitored_regions
end

#resource_analytics_instance_idString

[Required] The OCID of the ResourceAnalyticsInstance associated with this TenancyAttachment.

Returns:

  • (String)


51
52
53
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 51

def resource_analytics_instance_id
  @resource_analytics_instance_id
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>>)


112
113
114
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 112

def system_tags
  @system_tags
end

#tenancy_idString

[Required] The OCID of the tenancy associated with this TenancyAttachment.

Returns:

  • (String)


55
56
57
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 55

def tenancy_id
  @tenancy_id
end

#time_createdDateTime

[Required] The date and time the TenancyAttachment was created, in the format defined by RFC 3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


88
89
90
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 88

def time_created
  @time_created
end

#time_data_population_endedDateTime

The date and time the data population tasks completed, in the format defined by RFC 3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


81
82
83
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 81

def time_data_population_ended
  @time_data_population_ended
end

#time_data_population_startedDateTime

The date and time the data population tasks started, in the format defined by RFC 3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


74
75
76
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 74

def time_data_population_started
  @time_data_population_started
end

#time_updatedDateTime

The date and time the TenancyAttachment was updated, in the format defined by RFC 3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


95
96
97
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 95

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 115

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'description': :'description',
    'resource_analytics_instance_id': :'resourceAnalyticsInstanceId',
    'tenancy_id': :'tenancyId',
    'is_reporting_tenancy': :'isReportingTenancy',
    'monitored_regions': :'monitoredRegions',
    'data_population_status': :'dataPopulationStatus',
    'time_data_population_started': :'timeDataPopulationStarted',
    'time_data_population_ended': :'timeDataPopulationEnded',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 137

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'description': :'String',
    'resource_analytics_instance_id': :'String',
    'tenancy_id': :'String',
    'is_reporting_tenancy': :'BOOLEAN',
    'monitored_regions': :'Array<OCI::ResourceAnalytics::Models::TenancyAttachmentMonitoredRegionSummary>',
    'data_population_status': :'String',
    'time_data_population_started': :'DateTime',
    'time_data_population_ended': :'DateTime',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    '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



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 294

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

  self.class == other.class &&
    id == other.id &&
    description == other.description &&
    resource_analytics_instance_id == other.resource_analytics_instance_id &&
    tenancy_id == other.tenancy_id &&
    is_reporting_tenancy == other.is_reporting_tenancy &&
    monitored_regions == other.monitored_regions &&
    data_population_status == other.data_population_status &&
    time_data_population_started == other.time_data_population_started &&
    time_data_population_ended == other.time_data_population_ended &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    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



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 337

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


317
318
319
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 317

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



326
327
328
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 326

def hash
  [id, description, resource_analytics_instance_id, tenancy_id, is_reporting_tenancy, monitored_regions, data_population_status, time_data_population_started, time_data_population_ended, time_created, time_updated, 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



370
371
372
373
374
375
376
377
378
379
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 370

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



364
365
366
# File 'lib/oci/resource_analytics/models/tenancy_attachment.rb', line 364

def to_s
  to_hash.to_s
end