Class: Falcon::DomainAPIHostInfoFacetV1

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DomainAPIHostInfoFacetV1

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#asset_criticalityObject

Returns the value of attribute asset_criticality.



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

def asset_criticality
  @asset_criticality
end

#build_numberObject

Returns the value of attribute build_number.



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

def build_number
  @build_number
end

#groupsObject

Returns the value of attribute groups.



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

def groups
  @groups
end

#host_hidden_statusObject

Returns the value of attribute host_hidden_status.



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

def host_hidden_status
  @host_hidden_status
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#last_seen_timestampObject

Returns the value of attribute last_seen_timestamp.



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

def last_seen_timestamp
  @last_seen_timestamp
end

#local_ipObject

Returns the value of attribute local_ip.



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

def local_ip
  @local_ip
end

#mac_addressObject

Returns the value of attribute mac_address.



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

def mac_address
  @mac_address
end

#machine_domainObject

Returns the value of attribute machine_domain.



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

def machine_domain
  @machine_domain
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#os_versionObject

Returns the value of attribute os_version.



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

def os_version
  @os_version
end

#ouObject

Returns the value of attribute ou.



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

def ou
  @ou
end

#platform_nameObject

Returns the value of attribute platform_name.



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

def platform_name
  @platform_name
end

#product_type_descObject

Returns the value of attribute product_type_desc.



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

def product_type_desc
  @product_type_desc
end

#serial_numberObject

Returns the value of attribute serial_number.



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

def serial_number
  @serial_number
end

#site_nameObject

Returns the value of attribute site_name.



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

def site_name
  @site_name
end

#system_manufacturerObject

Returns the value of attribute system_manufacturer.



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

def system_manufacturer
  @system_manufacturer
end

#system_product_nameObject

Returns the value of attribute system_product_name.



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

def system_product_name
  @system_product_name
end

#tagsObject

Returns the value of attribute tags.



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

def tags
  @tags
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



99
100
101
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 99

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 74

def self.attribute_map
  {
    :'asset_criticality' => :'asset_criticality',
    :'build_number' => :'build_number',
    :'groups' => :'groups',
    :'host_hidden_status' => :'host_hidden_status',
    :'id' => :'id',
    :'last_seen_timestamp' => :'last_seen_timestamp',
    :'local_ip' => :'local_ip',
    :'mac_address' => :'mac_address',
    :'machine_domain' => :'machine_domain',
    :'name' => :'name',
    :'os_version' => :'os_version',
    :'ou' => :'ou',
    :'platform_name' => :'platform_name',
    :'product_type_desc' => :'product_type_desc',
    :'serial_number' => :'serial_number',
    :'site_name' => :'site_name',
    :'system_manufacturer' => :'system_manufacturer',
    :'system_product_name' => :'system_product_name',
    :'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



294
295
296
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 294

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

.openapi_nullableObject

List of attributes with nullable: true



129
130
131
132
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 129

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

.openapi_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 104

def self.openapi_types
  {
    :'asset_criticality' => :'DomainAssetCriticalityInfoV1',
    :'build_number' => :'String',
    :'groups' => :'Array<DomainAPIHostGroup>',
    :'host_hidden_status' => :'String',
    :'id' => :'String',
    :'last_seen_timestamp' => :'String',
    :'local_ip' => :'String',
    :'mac_address' => :'String',
    :'machine_domain' => :'String',
    :'name' => :'String',
    :'os_version' => :'String',
    :'ou' => :'String',
    :'platform_name' => :'String',
    :'product_type_desc' => :'String',
    :'serial_number' => :'String',
    :'site_name' => :'String',
    :'system_manufacturer' => :'String',
    :'system_product_name' => :'String',
    :'tags' => :'Array<String>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 255

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      asset_criticality == o.asset_criticality &&
      build_number == o.build_number &&
      groups == o.groups &&
      host_hidden_status == o.host_hidden_status &&
      id == o.id &&
      last_seen_timestamp == o.last_seen_timestamp &&
      local_ip == o.local_ip &&
      mac_address == o.mac_address &&
      machine_domain == o.machine_domain &&
      name == o.name &&
      os_version == o.os_version &&
      ou == o.ou &&
      platform_name == o.platform_name &&
      product_type_desc == o.product_type_desc &&
      serial_number == o.serial_number &&
      site_name == o.site_name &&
      system_manufacturer == o.system_manufacturer &&
      system_product_name == o.system_product_name &&
      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



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

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



396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 396

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



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 301

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


281
282
283
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 281

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



287
288
289
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 287

def hash
  [asset_criticality, build_number, groups, host_hidden_status, id, last_seen_timestamp, local_ip, mac_address, machine_domain, name, os_version, ou, platform_name, product_type_desc, serial_number, site_name, system_manufacturer, system_product_name, 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



232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 232

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

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



372
373
374
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 372

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



378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 378

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



366
367
368
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 366

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



247
248
249
250
251
# File 'lib/crimson-falcon/models/domain_api_host_info_facet_v1.rb', line 247

def valid?
  return false if @groups.nil?
  return false if @name.nil?
  true
end