Class: Falcon::ModelsComplianceExportGroupedByClustersReport

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ModelsComplianceExportGroupedByClustersReport

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#cidObject

Returns the value of attribute cid.



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

def cid
  @cid
end

#cloud_account_idObject

Returns the value of attribute cloud_account_id.



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

def 
  @cloud_account_id
end

#cloud_providerObject

Returns the value of attribute cloud_provider.



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

def cloud_provider
  @cloud_provider
end

#cloud_regionObject

Returns the value of attribute cloud_region.



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

def cloud_region
  @cloud_region
end

#cluster_nameObject

Returns the value of attribute cluster_name.



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

def cluster_name
  @cluster_name
end

#failed_critical_rulesObject

Returns the value of attribute failed_critical_rules.



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

def failed_critical_rules
  @failed_critical_rules
end

#failed_high_rulesObject

Returns the value of attribute failed_high_rules.



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

def failed_high_rules
  @failed_high_rules
end

#failed_rulesObject

Returns the value of attribute failed_rules.



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

def failed_rules
  @failed_rules
end

#failed_rules_listObject

Returns the value of attribute failed_rules_list.



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

def failed_rules_list
  @failed_rules_list
end

#non_compliant_containersObject

Returns the value of attribute non_compliant_containers.



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

def non_compliant_containers
  @non_compliant_containers
end

#non_compliant_imagesObject

Returns the value of attribute non_compliant_images.



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

def non_compliant_images
  @non_compliant_images
end

#passed_rulesObject

Returns the value of attribute passed_rules.



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

def passed_rules
  @passed_rules
end

#percentage_of_compliant_assetsObject

Returns the value of attribute percentage_of_compliant_assets.



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

def percentage_of_compliant_assets
  @percentage_of_compliant_assets
end

#total_containersObject

Returns the value of attribute total_containers.



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

def total_containers
  @total_containers
end

#total_imagesObject

Returns the value of attribute total_images.



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

def total_images
  @total_images
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



87
88
89
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 87

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 66

def self.attribute_map
  {
    :'cid' => :'cid',
    :'cloud_account_id' => :'cloud_account_id',
    :'cloud_provider' => :'cloud_provider',
    :'cloud_region' => :'cloud_region',
    :'cluster_name' => :'cluster_name',
    :'failed_critical_rules' => :'failed_critical_rules',
    :'failed_high_rules' => :'failed_high_rules',
    :'failed_rules' => :'failed_rules',
    :'failed_rules_list' => :'failed_rules_list',
    :'non_compliant_containers' => :'non_compliant_containers',
    :'non_compliant_images' => :'non_compliant_images',
    :'passed_rules' => :'passed_rules',
    :'percentage_of_compliant_assets' => :'percentage_of_compliant_assets',
    :'total_containers' => :'total_containers',
    :'total_images' => :'total_images'
  }
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



319
320
321
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 319

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

.openapi_nullableObject

List of attributes with nullable: true



113
114
115
116
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 113

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

.openapi_typesObject

Attribute type mapping.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 92

def self.openapi_types
  {
    :'cid' => :'String',
    :'cloud_account_id' => :'String',
    :'cloud_provider' => :'String',
    :'cloud_region' => :'String',
    :'cluster_name' => :'String',
    :'failed_critical_rules' => :'Integer',
    :'failed_high_rules' => :'Integer',
    :'failed_rules' => :'Integer',
    :'failed_rules_list' => :'String',
    :'non_compliant_containers' => :'Integer',
    :'non_compliant_images' => :'Integer',
    :'passed_rules' => :'Integer',
    :'percentage_of_compliant_assets' => :'Float',
    :'total_containers' => :'Integer',
    :'total_images' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 284

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      cid == o.cid &&
       == o. &&
      cloud_provider == o.cloud_provider &&
      cloud_region == o.cloud_region &&
      cluster_name == o.cluster_name &&
      failed_critical_rules == o.failed_critical_rules &&
      failed_high_rules == o.failed_high_rules &&
      failed_rules == o.failed_rules &&
      failed_rules_list == o.failed_rules_list &&
      non_compliant_containers == o.non_compliant_containers &&
      non_compliant_images == o.non_compliant_images &&
      passed_rules == o.passed_rules &&
      percentage_of_compliant_assets == o.percentage_of_compliant_assets &&
      total_containers == o.total_containers &&
      total_images == o.total_images
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



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
384
385
386
387
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 350

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



421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 421

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



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

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


306
307
308
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 306

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



312
313
314
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 312

def hash
  [cid, , cloud_provider, cloud_region, cluster_name, failed_critical_rules, failed_high_rules, failed_rules, failed_rules_list, non_compliant_containers, non_compliant_images, passed_rules, percentage_of_compliant_assets, total_containers, total_images].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 196

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



397
398
399
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 397

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



403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 403

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



391
392
393
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 391

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



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/crimson-falcon/models/models_compliance_export_grouped_by_clusters_report.rb', line 263

def valid?
  return false if @cid.nil?
  return false if @cloud_account_id.nil?
  return false if @cloud_provider.nil?
  return false if @cloud_region.nil?
  return false if @cluster_name.nil?
  return false if @failed_critical_rules.nil?
  return false if @failed_high_rules.nil?
  return false if @failed_rules.nil?
  return false if @failed_rules_list.nil?
  return false if @non_compliant_containers.nil?
  return false if @non_compliant_images.nil?
  return false if @passed_rules.nil?
  return false if @percentage_of_compliant_assets.nil?
  return false if @total_containers.nil?
  return false if @total_images.nil?
  true
end