Class: Falcon::DomainOCITenancyV1

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/models/domain_oci_tenancy_v1.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DomainOCITenancyV1

Initializes the object

Parameters:

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

    Model attributes in the form of hash



176
177
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
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
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 176

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::DomainOCITenancyV1` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Falcon::DomainOCITenancyV1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'cid')
    self.cid = attributes[:'cid']
  end

  if attributes.key?(:'conditions')
    if (value = attributes[:'conditions']).is_a?(Array)
      self.conditions = value
    end
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.key?(:'cspm_enabled')
    self.cspm_enabled = attributes[:'cspm_enabled']
  end

  if attributes.key?(:'finger_print')
    self.finger_print = attributes[:'finger_print']
  end

  if attributes.key?(:'group_name')
    self.group_name = attributes[:'group_name']
  end

  if attributes.key?(:'group_ocid')
    self.group_ocid = attributes[:'group_ocid']
  end

  if attributes.key?(:'home_region')
    self.home_region = attributes[:'home_region']
  end

  if attributes.key?(:'is_connected')
    self.is_connected = attributes[:'is_connected']
  end

  if attributes.key?(:'key_age')
    self.key_age = attributes[:'key_age']
  end

  if attributes.key?(:'overall_status')
    self.overall_status = attributes[:'overall_status']
  end

  if attributes.key?(:'policy_name')
    self.policy_name = attributes[:'policy_name']
  end

  if attributes.key?(:'policy_ocid')
    self.policy_ocid = attributes[:'policy_ocid']
  end

  if attributes.key?(:'private_key')
    self.private_key = attributes[:'private_key']
  end

  if attributes.key?(:'products')
    if (value = attributes[:'products']).is_a?(Hash)
      self.products = value
    end
  end

  if attributes.key?(:'public_key')
    self.public_key = attributes[:'public_key']
  end

  if attributes.key?(:'stack_name')
    self.stack_name = attributes[:'stack_name']
  end

  if attributes.key?(:'stack_ocid')
    self.stack_ocid = attributes[:'stack_ocid']
  end

  if attributes.key?(:'tenancy_name')
    self.tenancy_name = attributes[:'tenancy_name']
  end

  if attributes.key?(:'tenancy_ocid')
    self.tenancy_ocid = attributes[:'tenancy_ocid']
  end

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  end

  if attributes.key?(:'user_email')
    self.user_email = attributes[:'user_email']
  end

  if attributes.key?(:'user_name')
    self.user_name = attributes[:'user_name']
  end

  if attributes.key?(:'user_ocid')
    self.user_ocid = attributes[:'user_ocid']
  end
end

Instance Attribute Details

#cidObject

Returns the value of attribute cid.



35
36
37
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 35

def cid
  @cid
end

#conditionsObject

Returns the value of attribute conditions.



37
38
39
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 37

def conditions
  @conditions
end

#created_atObject

OCI Tenancy created date



40
41
42
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 40

def created_at
  @created_at
end

#cspm_enabledObject

Returns the value of attribute cspm_enabled.



42
43
44
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 42

def cspm_enabled
  @cspm_enabled
end

#finger_printObject

OCI Tenancy Registration fingerprint



45
46
47
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 45

def finger_print
  @finger_print
end

#group_nameObject

OCI Tenancy group name



48
49
50
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 48

def group_name
  @group_name
end

#group_ocidObject

Group OCID



51
52
53
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 51

def group_ocid
  @group_ocid
end

#home_regionObject

Region of OCI Account/Tenancy



54
55
56
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 54

def home_region
  @home_region
end

#is_connectedObject

Connection to OCI succeeded or not



57
58
59
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 57

def is_connected
  @is_connected
end

#key_ageObject

OCI Tenancy key age



60
61
62
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 60

def key_age
  @key_age
end

#overall_statusObject

OCI Tenancy Registration status



63
64
65
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 63

def overall_status
  @overall_status
end

#policy_nameObject

OCI Tenancy policy name



66
67
68
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 66

def policy_name
  @policy_name
end

#policy_ocidObject

Policy OCID



69
70
71
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 69

def policy_ocid
  @policy_ocid
end

#private_keyObject

OCI Tenancy Registration private key



72
73
74
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 72

def private_key
  @private_key
end

#productsObject

Tenancy registration details for each product and feature



75
76
77
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 75

def products
  @products
end

#public_keyObject

OCI Tenancy Registration public key



78
79
80
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 78

def public_key
  @public_key
end

#stack_nameObject

OCI Tenancy stack name



81
82
83
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 81

def stack_name
  @stack_name
end

#stack_ocidObject

OCI Tenancy stack OCID



84
85
86
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 84

def stack_ocid
  @stack_ocid
end

#tenancy_nameObject

Returns the value of attribute tenancy_name.



86
87
88
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 86

def tenancy_name
  @tenancy_name
end

#tenancy_ocidObject

OCI provided unique identifier for the account.



89
90
91
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 89

def tenancy_ocid
  @tenancy_ocid
end

#updated_atObject

OCI Tenancy updated date



92
93
94
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 92

def updated_at
  @updated_at
end

#user_emailObject

User email



95
96
97
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 95

def user_email
  @user_email
end

#user_nameObject

OCI Tenancy user name



98
99
100
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 98

def user_name
  @user_name
end

#user_ocidObject

User OCID



101
102
103
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 101

def user_ocid
  @user_ocid
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



134
135
136
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 134

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



104
105
106
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
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 104

def self.attribute_map
  {
    :'cid' => :'cid',
    :'conditions' => :'conditions',
    :'created_at' => :'created_at',
    :'cspm_enabled' => :'cspm_enabled',
    :'finger_print' => :'finger_print',
    :'group_name' => :'group_name',
    :'group_ocid' => :'group_ocid',
    :'home_region' => :'home_region',
    :'is_connected' => :'is_connected',
    :'key_age' => :'key_age',
    :'overall_status' => :'overall_status',
    :'policy_name' => :'policy_name',
    :'policy_ocid' => :'policy_ocid',
    :'private_key' => :'private_key',
    :'products' => :'products',
    :'public_key' => :'public_key',
    :'stack_name' => :'stack_name',
    :'stack_ocid' => :'stack_ocid',
    :'tenancy_name' => :'tenancy_name',
    :'tenancy_ocid' => :'tenancy_ocid',
    :'updated_at' => :'updated_at',
    :'user_email' => :'user_email',
    :'user_name' => :'user_name',
    :'user_ocid' => :'user_ocid'
  }
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



459
460
461
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 459

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



169
170
171
172
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 169

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 139

def self.openapi_types
  {
    :'cid' => :'String',
    :'conditions' => :'Array<DomainCloudCondition>',
    :'created_at' => :'Time',
    :'cspm_enabled' => :'Boolean',
    :'finger_print' => :'String',
    :'group_name' => :'String',
    :'group_ocid' => :'String',
    :'home_region' => :'String',
    :'is_connected' => :'Boolean',
    :'key_age' => :'Integer',
    :'overall_status' => :'String',
    :'policy_name' => :'String',
    :'policy_ocid' => :'String',
    :'private_key' => :'String',
    :'products' => :'Hash<String, Hash>',
    :'public_key' => :'String',
    :'stack_name' => :'String',
    :'stack_ocid' => :'String',
    :'tenancy_name' => :'String',
    :'tenancy_ocid' => :'String',
    :'updated_at' => :'Time',
    :'user_email' => :'String',
    :'user_name' => :'String',
    :'user_ocid' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 415

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      cid == o.cid &&
      conditions == o.conditions &&
      created_at == o.created_at &&
      cspm_enabled == o.cspm_enabled &&
      finger_print == o.finger_print &&
      group_name == o.group_name &&
      group_ocid == o.group_ocid &&
      home_region == o.home_region &&
      is_connected == o.is_connected &&
      key_age == o.key_age &&
      overall_status == o.overall_status &&
      policy_name == o.policy_name &&
      policy_ocid == o.policy_ocid &&
      private_key == o.private_key &&
      products == o.products &&
      public_key == o.public_key &&
      stack_name == o.stack_name &&
      stack_ocid == o.stack_ocid &&
      tenancy_name == o.tenancy_name &&
      tenancy_ocid == o.tenancy_ocid &&
      updated_at == o.updated_at &&
      user_email == o.user_email &&
      user_name == o.user_name &&
      user_ocid == o.user_ocid
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 490

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Falcon.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 561

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
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



466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 466

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


446
447
448
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 446

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



452
453
454
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 452

def hash
  [cid, conditions, created_at, cspm_enabled, finger_print, group_name, group_ocid, home_region, is_connected, key_age, overall_status, policy_name, policy_ocid, private_key, products, public_key, stack_name, stack_ocid, tenancy_name, tenancy_ocid, updated_at, user_email, user_name, user_ocid].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
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
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 292

def list_invalid_properties
  invalid_properties = Array.new
  if @cid.nil?
    invalid_properties.push('invalid value for "cid", cid cannot be nil.')
  end

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
  end

  if @cspm_enabled.nil?
    invalid_properties.push('invalid value for "cspm_enabled", cspm_enabled cannot be nil.')
  end

  if @finger_print.nil?
    invalid_properties.push('invalid value for "finger_print", finger_print cannot be nil.')
  end

  if @group_name.nil?
    invalid_properties.push('invalid value for "group_name", group_name cannot be nil.')
  end

  if @group_ocid.nil?
    invalid_properties.push('invalid value for "group_ocid", group_ocid cannot be nil.')
  end

  if @home_region.nil?
    invalid_properties.push('invalid value for "home_region", home_region cannot be nil.')
  end

  if @is_connected.nil?
    invalid_properties.push('invalid value for "is_connected", is_connected cannot be nil.')
  end

  if @key_age.nil?
    invalid_properties.push('invalid value for "key_age", key_age cannot be nil.')
  end

  if @overall_status.nil?
    invalid_properties.push('invalid value for "overall_status", overall_status cannot be nil.')
  end

  if @policy_name.nil?
    invalid_properties.push('invalid value for "policy_name", policy_name cannot be nil.')
  end

  if @policy_ocid.nil?
    invalid_properties.push('invalid value for "policy_ocid", policy_ocid cannot be nil.')
  end

  if @products.nil?
    invalid_properties.push('invalid value for "products", products cannot be nil.')
  end

  if @public_key.nil?
    invalid_properties.push('invalid value for "public_key", public_key cannot be nil.')
  end

  if @stack_name.nil?
    invalid_properties.push('invalid value for "stack_name", stack_name cannot be nil.')
  end

  if @stack_ocid.nil?
    invalid_properties.push('invalid value for "stack_ocid", stack_ocid cannot be nil.')
  end

  if @tenancy_name.nil?
    invalid_properties.push('invalid value for "tenancy_name", tenancy_name cannot be nil.')
  end

  if @tenancy_ocid.nil?
    invalid_properties.push('invalid value for "tenancy_ocid", tenancy_ocid cannot be nil.')
  end

  if @updated_at.nil?
    invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
  end

  if @user_email.nil?
    invalid_properties.push('invalid value for "user_email", user_email cannot be nil.')
  end

  if @user_name.nil?
    invalid_properties.push('invalid value for "user_name", user_name cannot be nil.')
  end

  if @user_ocid.nil?
    invalid_properties.push('invalid value for "user_ocid", user_ocid cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



537
538
539
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 537

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



543
544
545
546
547
548
549
550
551
552
553
554
555
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 543

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



531
532
533
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 531

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/crimson-falcon/models/domain_oci_tenancy_v1.rb', line 387

def valid?
  return false if @cid.nil?
  return false if @created_at.nil?
  return false if @cspm_enabled.nil?
  return false if @finger_print.nil?
  return false if @group_name.nil?
  return false if @group_ocid.nil?
  return false if @home_region.nil?
  return false if @is_connected.nil?
  return false if @key_age.nil?
  return false if @overall_status.nil?
  return false if @policy_name.nil?
  return false if @policy_ocid.nil?
  return false if @products.nil?
  return false if @public_key.nil?
  return false if @stack_name.nil?
  return false if @stack_ocid.nil?
  return false if @tenancy_name.nil?
  return false if @tenancy_ocid.nil?
  return false if @updated_at.nil?
  return false if @user_email.nil?
  return false if @user_name.nil?
  return false if @user_ocid.nil?
  true
end