Class: SwaggerClient::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Report

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 158

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#baselineObject

If the template is ‘baseline-comparison` or `executive-overview` the baseline scan to compare against. This can be the `first` scan, the `previous` scan, or a scan as of a specified date. Defaults to `previous`.



17
18
19
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 17

def baseline
  @baseline
end

#bureauObject

The name of the bureau for a CyberScope report. Only used when the format is ‘"cyberscope-xml"`.



20
21
22
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 20

def bureau
  @bureau
end

#componentObject

The name of the component for a CyberScope report. Only used when the format is ‘"cyberscope-xml"`.



23
24
25
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 23

def component
  @component
end

#emailObject

Returns the value of attribute email.



25
26
27
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 25

def email
  @email
end

#enclaveObject

The name of the enclave for a CyberScope report. Only used when the format is ‘"cyberscope-xml"`.



28
29
30
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 28

def enclave
  @enclave
end

#filtersObject

Returns the value of attribute filters.



30
31
32
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 30

def filters
  @filters
end

#formatObject

The output format of the report. The format will restrict the available templates and parameters that can be specified.



33
34
35
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 33

def format
  @format
end

#frequencyObject

Returns the value of attribute frequency.



35
36
37
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 35

def frequency
  @frequency
end

#idObject

The identifier of the report.



38
39
40
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 38

def id
  @id
end

#languageObject

The locale (language) in which the report is generated



41
42
43
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 41

def language
  @language
end

Hypermedia links to corresponding or related resources.



44
45
46
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 44

def links
  @links
end

#nameObject

The name of the report.



47
48
49
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 47

def name
  @name
end

#organizationObject

The organization used for a XCCDF XML report. Only used when the format is ‘"xccdf-xml"`.



50
51
52
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 50

def organization
  @organization
end

#ownerObject

The identifier of the report owner.



53
54
55
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 53

def owner
  @owner
end

#policiesObject

If the template is ‘rule-breakdown-summary`, `top-policy-remediations`, or `top-policy-remediations-with-details` the identifiers of the policies to report against.



56
57
58
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 56

def policies
  @policies
end

#policyObject

The policy to report on. Only used when the format is ‘"oval-xml"`, `""xccdf-csv"`, or `"xccdf-xml"`.



59
60
61
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 59

def policy
  @policy
end

#queryObject

SQL query to run against the Reporting Data Model. Only used when the format is ‘"sql-query"`.



62
63
64
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 62

def query
  @query
end

#rangeObject

Returns the value of attribute range.



64
65
66
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 64

def range
  @range
end

#remediationObject

Returns the value of attribute remediation.



66
67
68
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 66

def remediation
  @remediation
end

#risk_trendObject

Returns the value of attribute risk_trend.



68
69
70
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 68

def risk_trend
  @risk_trend
end

#scopeObject

Returns the value of attribute scope.



70
71
72
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 70

def scope
  @scope
end

#storageObject

Returns the value of attribute storage.



72
73
74
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 72

def storage
  @storage
end

#templateObject

The template for the report (only required if the format is templatized).



75
76
77
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 75

def template
  @template
end

#timezoneObject

The timezone the report generates in, such as ‘"America/Los_Angeles"`.



78
79
80
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 78

def timezone
  @timezone
end

#usersObject

The identifiers of the users granted explicit access to the report.



81
82
83
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 81

def users
  @users
end

#versionObject

The version of the report Data Model to report against. Only used when the format is ‘"sql-query"`.



84
85
86
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 84

def version
  @version
end

Class Method Details

.attribute_mapObject

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



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 87

def self.attribute_map
  {
    :'baseline' => :'baseline',
    :'bureau' => :'bureau',
    :'component' => :'component',
    :'email' => :'email',
    :'enclave' => :'enclave',
    :'filters' => :'filters',
    :'format' => :'format',
    :'frequency' => :'frequency',
    :'id' => :'id',
    :'language' => :'language',
    :'links' => :'links',
    :'name' => :'name',
    :'organization' => :'organization',
    :'owner' => :'owner',
    :'policies' => :'policies',
    :'policy' => :'policy',
    :'query' => :'query',
    :'range' => :'range',
    :'remediation' => :'remediation',
    :'risk_trend' => :'riskTrend',
    :'scope' => :'scope',
    :'storage' => :'storage',
    :'template' => :'template',
    :'timezone' => :'timezone',
    :'users' => :'users',
    :'version' => :'version'
  }
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



343
344
345
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 343

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

.openapi_nullableObject

List of attributes with nullable: true



151
152
153
154
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 151

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

.openapi_typesObject

Attribute type mapping.



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
145
146
147
148
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 119

def self.openapi_types
  {
    :'baseline' => :'Object',
    :'bureau' => :'Object',
    :'component' => :'Object',
    :'email' => :'Object',
    :'enclave' => :'Object',
    :'filters' => :'Object',
    :'format' => :'Object',
    :'frequency' => :'Object',
    :'id' => :'Object',
    :'language' => :'Object',
    :'links' => :'Object',
    :'name' => :'Object',
    :'organization' => :'Object',
    :'owner' => :'Object',
    :'policies' => :'Object',
    :'policy' => :'Object',
    :'query' => :'Object',
    :'range' => :'Object',
    :'remediation' => :'Object',
    :'risk_trend' => :'Object',
    :'scope' => :'Object',
    :'storage' => :'Object',
    :'template' => :'Object',
    :'timezone' => :'Object',
    :'users' => :'Object',
    :'version' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 297

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      baseline == o.baseline &&
      bureau == o.bureau &&
      component == o.component &&
      email == o.email &&
      enclave == o.enclave &&
      filters == o.filters &&
      format == o.format &&
      frequency == o.frequency &&
      id == o.id &&
      language == o.language &&
      links == o.links &&
      name == o.name &&
      organization == o.organization &&
      owner == o.owner &&
      policies == o.policies &&
      policy == o.policy &&
      query == o.query &&
      range == o.range &&
      remediation == o.remediation &&
      risk_trend == o.risk_trend &&
      scope == o.scope &&
      storage == o.storage &&
      template == o.template &&
      timezone == o.timezone &&
      users == o.users &&
      version == o.version
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



373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 373

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.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
    SwaggerClient.const_get(type).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



442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 442

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



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 350

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if 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]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


330
331
332
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 330

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



336
337
338
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 336

def hash
  [baseline, bureau, component, email, enclave, filters, format, frequency, id, language, links, name, organization, owner, policies, policy, query, range, remediation, risk_trend, scope, storage, template, timezone, users, version].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



284
285
286
287
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 284

def list_invalid_properties
  invalid_properties = Array.new
  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



418
419
420
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 418

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



424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 424

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



412
413
414
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 412

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



291
292
293
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/report.rb', line 291

def valid?
  true
end