Class: Falcon::TypesServiceNowService

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TypesServiceNowService

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 152

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#application_serverObject

Returns the value of attribute application_server.



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

def application_server
  @application_server
end

#business_applicationsObject

Returns the value of attribute business_applications.



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

def business_applications
  @business_applications
end

#consumersObject

Returns the value of attribute consumers.



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

def consumers
  @consumers
end

#datasource_countObject

Returns the value of attribute datasource_count.



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

def datasource_count
  @datasource_count
end

#dependenciesObject

Returns the value of attribute dependencies.



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

def dependencies
  @dependencies
end

#downstream_countObject

Returns the value of attribute downstream_count.



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

def downstream_count
  @downstream_count
end

#group_byObject

Returns the value of attribute group_by.



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

def group_by
  @group_by
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#language_typeObject

Returns the value of attribute language_type.



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

def language_type
  @language_type
end

#language_versionObject

Returns the value of attribute language_version.



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

def language_version
  @language_version
end

#mom_countObject

Returns the value of attribute mom_count.



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

def mom_count
  @mom_count
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#owner_departmentObject

Returns the value of attribute owner_department.



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

def owner_department
  @owner_department
end

#owner_emailObject

Returns the value of attribute owner_email.



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

def owner_email
  @owner_email
end

#owner_nameObject

Returns the value of attribute owner_name.



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

def owner_name
  @owner_name
end

#persistent_signatureObject

Returns the value of attribute persistent_signature.



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

def persistent_signature
  @persistent_signature
end

#propertiesObject

Returns the value of attribute properties.



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

def properties
  @properties
end

#service_versionObject

Returns the value of attribute service_version.



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

def service_version
  @service_version
end

#tagsObject

Returns the value of attribute tags.



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

def tags
  @tags
end

#technology_typeObject

Returns the value of attribute technology_type.



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

def technology_type
  @technology_type
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



77
78
79
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 77

def updated_at
  @updated_at
end

#upstream_countObject

Returns the value of attribute upstream_count.



79
80
81
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 79

def upstream_count
  @upstream_count
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



111
112
113
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 111

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 82

def self.attribute_map
  {
    :'application_server' => :'applicationServer',
    :'business_applications' => :'businessApplications',
    :'consumers' => :'consumers',
    :'datasource_count' => :'datasourceCount',
    :'dependencies' => :'dependencies',
    :'downstream_count' => :'downstreamCount',
    :'group_by' => :'groupBy',
    :'id' => :'id',
    :'language_type' => :'languageType',
    :'language_version' => :'languageVersion',
    :'mom_count' => :'momCount',
    :'name' => :'name',
    :'owner_department' => :'ownerDepartment',
    :'owner_email' => :'ownerEmail',
    :'owner_name' => :'ownerName',
    :'persistent_signature' => :'persistentSignature',
    :'properties' => :'properties',
    :'service_version' => :'serviceVersion',
    :'tags' => :'tags',
    :'technology_type' => :'technologyType',
    :'type' => :'type',
    :'updated_at' => :'updatedAt',
    :'upstream_count' => :'upstreamCount'
  }
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



433
434
435
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 433

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

.openapi_nullableObject

List of attributes with nullable: true



145
146
147
148
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 145

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

.openapi_typesObject

Attribute type mapping.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 116

def self.openapi_types
  {
    :'application_server' => :'String',
    :'business_applications' => :'TypesServiceServiceBusinessApplication',
    :'consumers' => :'Integer',
    :'datasource_count' => :'Integer',
    :'dependencies' => :'Integer',
    :'downstream_count' => :'Integer',
    :'group_by' => :'Hash<String, Object>',
    :'id' => :'Integer',
    :'language_type' => :'String',
    :'language_version' => :'String',
    :'mom_count' => :'Integer',
    :'name' => :'String',
    :'owner_department' => :'String',
    :'owner_email' => :'String',
    :'owner_name' => :'String',
    :'persistent_signature' => :'String',
    :'properties' => :'TypesServiceServiceTraits',
    :'service_version' => :'String',
    :'tags' => :'TypesServiceServiceTag',
    :'technology_type' => :'String',
    :'type' => :'String',
    :'updated_at' => :'Integer',
    :'upstream_count' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 390

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      application_server == o.application_server &&
      business_applications == o.business_applications &&
      consumers == o.consumers &&
      datasource_count == o.datasource_count &&
      dependencies == o.dependencies &&
      downstream_count == o.downstream_count &&
      group_by == o.group_by &&
      id == o.id &&
      language_type == o.language_type &&
      language_version == o.language_version &&
      mom_count == o.mom_count &&
      name == o.name &&
      owner_department == o.owner_department &&
      owner_email == o.owner_email &&
      owner_name == o.owner_name &&
      persistent_signature == o.persistent_signature &&
      properties == o.properties &&
      service_version == o.service_version &&
      tags == o.tags &&
      technology_type == o.technology_type &&
      type == o.type &&
      updated_at == o.updated_at &&
      upstream_count == o.upstream_count
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



464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 464

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



535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 535

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



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 440

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


420
421
422
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 420

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



426
427
428
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 426

def hash
  [application_server, business_applications, consumers, datasource_count, dependencies, downstream_count, group_by, id, language_type, language_version, mom_count, name, owner_department, owner_email, owner_name, persistent_signature, properties, service_version, tags, technology_type, type, updated_at, upstream_count].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



511
512
513
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 511

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



517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 517

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



505
506
507
# File 'lib/crimson-falcon/models/types_service_now_service.rb', line 505

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



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

def valid?
  return false if @application_server.nil?
  return false if @business_applications.nil?
  return false if @consumers.nil?
  return false if @datasource_count.nil?
  return false if @dependencies.nil?
  return false if @downstream_count.nil?
  return false if @group_by.nil?
  return false if @id.nil?
  return false if @language_type.nil?
  return false if @language_version.nil?
  return false if @mom_count.nil?
  return false if @name.nil?
  return false if @owner_department.nil?
  return false if @owner_email.nil?
  return false if @owner_name.nil?
  return false if @persistent_signature.nil?
  return false if @properties.nil?
  return false if @service_version.nil?
  return false if @tags.nil?
  return false if @technology_type.nil?
  return false if @type.nil?
  return false if @updated_at.nil?
  return false if @upstream_count.nil?
  true
end