Class: Falcon::RegistrationIOMEvent

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RegistrationIOMEvent

Initializes the object

Parameters:

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

    Model attributes in the form of hash



144
145
146
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
173
174
175
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
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 144

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::RegistrationIOMEvent` 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::RegistrationIOMEvent`. 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?(:'account_id')
    self. = attributes[:'account_id']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



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

def 
  @account_id
end

#account_nameObject

Returns the value of attribute account_name.



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

def 
  @account_name
end

#azure_tenant_idObject

Returns the value of attribute azure_tenant_id.



39
40
41
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 39

def azure_tenant_id
  @azure_tenant_id
end

#cidObject

Returns the value of attribute cid.



41
42
43
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 41

def cid
  @cid
end

#cloud_providerObject

Returns the value of attribute cloud_provider.



43
44
45
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 43

def cloud_provider
  @cloud_provider
end

#custom_policy_idObject

Returns the value of attribute custom_policy_id.



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

def custom_policy_id
  @custom_policy_id
end

#findingObject

Returns the value of attribute finding.



47
48
49
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 47

def finding
  @finding
end

#policy_idObject

Returns the value of attribute policy_id.



49
50
51
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 49

def policy_id
  @policy_id
end

#policy_statementObject

Returns the value of attribute policy_statement.



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

def policy_statement
  @policy_statement
end

#policy_typeObject

Returns the value of attribute policy_type.



53
54
55
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 53

def policy_type
  @policy_type
end

#regionObject

Returns the value of attribute region.



55
56
57
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 55

def region
  @region
end

#report_date_timeObject

Returns the value of attribute report_date_time.



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

def report_date_time
  @report_date_time
end

#resource_attributesObject

Returns the value of attribute resource_attributes.



59
60
61
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 59

def resource_attributes
  @resource_attributes
end

#resource_create_timeObject

Returns the value of attribute resource_create_time.



61
62
63
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 61

def resource_create_time
  @resource_create_time
end

#resource_idObject

Returns the value of attribute resource_id.



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

def resource_id
  @resource_id
end

#resource_id_typeObject

Returns the value of attribute resource_id_type.



65
66
67
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 65

def resource_id_type
  @resource_id_type
end

#resource_urlObject

Returns the value of attribute resource_url.



67
68
69
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 67

def resource_url
  @resource_url
end

#serviceObject

Returns the value of attribute service.



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

def service
  @service
end

#severityObject

Returns the value of attribute severity.



71
72
73
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 71

def severity
  @severity
end

#statusObject

Returns the value of attribute status.



73
74
75
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 73

def status
  @status
end

#tagsObject

Returns the value of attribute tags.



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

def tags
  @tags
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



105
106
107
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 105

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 78

def self.attribute_map
  {
    :'account_id' => :'account_id',
    :'account_name' => :'account_name',
    :'azure_tenant_id' => :'azure_tenant_id',
    :'cid' => :'cid',
    :'cloud_provider' => :'cloud_provider',
    :'custom_policy_id' => :'custom_policy_id',
    :'finding' => :'finding',
    :'policy_id' => :'policy_id',
    :'policy_statement' => :'policy_statement',
    :'policy_type' => :'policy_type',
    :'region' => :'region',
    :'report_date_time' => :'report_date_time',
    :'resource_attributes' => :'resource_attributes',
    :'resource_create_time' => :'resource_create_time',
    :'resource_id' => :'resource_id',
    :'resource_id_type' => :'resource_id_type',
    :'resource_url' => :'resource_url',
    :'service' => :'service',
    :'severity' => :'severity',
    :'status' => :'status',
    :'tags' => :'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



388
389
390
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 388

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

.openapi_nullableObject

List of attributes with nullable: true



137
138
139
140
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 137

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'account_id' => :'String',
    :'account_name' => :'String',
    :'azure_tenant_id' => :'String',
    :'cid' => :'String',
    :'cloud_provider' => :'String',
    :'custom_policy_id' => :'String',
    :'finding' => :'String',
    :'policy_id' => :'String',
    :'policy_statement' => :'String',
    :'policy_type' => :'String',
    :'region' => :'String',
    :'report_date_time' => :'String',
    :'resource_attributes' => :'String',
    :'resource_create_time' => :'String',
    :'resource_id' => :'String',
    :'resource_id_type' => :'String',
    :'resource_url' => :'String',
    :'service' => :'String',
    :'severity' => :'String',
    :'status' => :'String',
    :'tags' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
       == o. &&
      azure_tenant_id == o.azure_tenant_id &&
      cid == o.cid &&
      cloud_provider == o.cloud_provider &&
      custom_policy_id == o.custom_policy_id &&
      finding == o.finding &&
      policy_id == o.policy_id &&
      policy_statement == o.policy_statement &&
      policy_type == o.policy_type &&
      region == o.region &&
      report_date_time == o.report_date_time &&
      resource_attributes == o.resource_attributes &&
      resource_create_time == o.resource_create_time &&
      resource_id == o.resource_id &&
      resource_id_type == o.resource_id_type &&
      resource_url == o.resource_url &&
      service == o.service &&
      severity == o.severity &&
      status == o.status &&
      tags == o.tags
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



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 419

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



490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 490

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



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 395

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


375
376
377
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 375

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



381
382
383
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 381

def hash
  [, , azure_tenant_id, cid, cloud_provider, custom_policy_id, finding, policy_id, policy_statement, policy_type, region, report_date_time, resource_attributes, resource_create_time, resource_id, resource_id_type, resource_url, service, severity, status, tags].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
314
315
316
317
318
319
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 244

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if @tags.nil?
    invalid_properties.push('invalid value for "tags", tags 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



466
467
468
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 466

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



472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 472

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



460
461
462
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 460

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



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/crimson-falcon/models/registration_iom_event.rb', line 323

def valid?
  return false if @account_id.nil?
  return false if @account_name.nil?
  return false if @azure_tenant_id.nil?
  return false if @cid.nil?
  return false if @cloud_provider.nil?
  return false if @finding.nil?
  return false if @policy_statement.nil?
  return false if @region.nil?
  return false if @report_date_time.nil?
  return false if @resource_attributes.nil?
  return false if @resource_create_time.nil?
  return false if @resource_id.nil?
  return false if @resource_id_type.nil?
  return false if @resource_url.nil?
  return false if @service.nil?
  return false if @severity.nil?
  return false if @status.nil?
  return false if @tags.nil?
  true
end