Class: Falcon::AppAppInventory

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AppAppInventory

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#access_levelObject

Returns the value of attribute access_level.



34
35
36
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 34

def access_level
  @access_level
end

#account_idObject

Returns the value of attribute account_id.



36
37
38
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 36

def 
  @account_id
end

#app_idObject

Returns the value of attribute app_id.



38
39
40
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 38

def app_id
  @app_id
end

#app_nameObject

Returns the value of attribute app_name.



40
41
42
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 40

def app_name
  @app_name
end

#app_typeObject

Returns the value of attribute app_type.



42
43
44
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 42

def app_type
  @app_type
end

#createdObject

Returns the value of attribute created.



44
45
46
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 44

def created
  @created
end

#integration_aliasObject

Returns the value of attribute integration_alias.



46
47
48
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 46

def integration_alias
  @integration_alias
end

#integration_idObject

Returns the value of attribute integration_id.



48
49
50
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 48

def integration_id
  @integration_id
end

#integration_nameObject

Returns the value of attribute integration_name.



50
51
52
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 50

def integration_name
  @integration_name
end

#item_idObject

Returns the value of attribute item_id.



52
53
54
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 52

def item_id
  @item_id
end

#last_activityObject

Returns the value of attribute last_activity.



54
55
56
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 54

def last_activity
  @last_activity
end

#scopesObject

Returns the value of attribute scopes.



56
57
58
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 56

def scopes
  @scopes
end

#statusObject

Returns the value of attribute status.



58
59
60
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 58

def status
  @status
end

#status_expiration_dateObject

Returns the value of attribute status_expiration_date.



60
61
62
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 60

def status_expiration_date
  @status_expiration_date
end

#status_reasonObject

Returns the value of attribute status_reason.



62
63
64
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 62

def status_reason
  @status_reason
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



86
87
88
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 86

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'access_level' => :'access_level',
    :'account_id' => :'account_id',
    :'app_id' => :'app_id',
    :'app_name' => :'app_name',
    :'app_type' => :'app_type',
    :'created' => :'created',
    :'integration_alias' => :'integration_alias',
    :'integration_id' => :'integration_id',
    :'integration_name' => :'integration_name',
    :'item_id' => :'item_id',
    :'last_activity' => :'last_activity',
    :'scopes' => :'scopes',
    :'status' => :'status',
    :'status_expiration_date' => :'status_expiration_date',
    :'status_reason' => :'status_reason'
  }
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



491
492
493
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 491

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

.openapi_nullableObject

List of attributes with nullable: true



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

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'access_level' => :'String',
    :'account_id' => :'String',
    :'app_id' => :'String',
    :'app_name' => :'String',
    :'app_type' => :'String',
    :'created' => :'Time',
    :'integration_alias' => :'String',
    :'integration_id' => :'String',
    :'integration_name' => :'String',
    :'item_id' => :'String',
    :'last_activity' => :'Time',
    :'scopes' => :'Array<String>',
    :'status' => :'String',
    :'status_expiration_date' => :'Time',
    :'status_reason' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 456

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      access_level == o.access_level &&
       == o. &&
      app_id == o.app_id &&
      app_name == o.app_name &&
      app_type == o.app_type &&
      created == o.created &&
      integration_alias == o.integration_alias &&
      integration_id == o.integration_id &&
      integration_name == o.integration_name &&
      item_id == o.item_id &&
      last_activity == o.last_activity &&
      scopes == o.scopes &&
      status == o.status &&
      status_expiration_date == o.status_expiration_date &&
      status_reason == o.status_reason
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



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 522

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



593
594
595
596
597
598
599
600
601
602
603
604
605
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 593

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



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 498

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


478
479
480
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 478

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



484
485
486
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 484

def hash
  [access_level, , app_id, app_name, app_type, created, integration_alias, integration_id, integration_name, item_id, last_activity, scopes, status, status_expiration_date, status_reason].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 197

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

  if @access_level.to_s.length < 1
    invalid_properties.push('invalid value for "access_level", the character length must be great than or equal to 1.')
  end

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

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

  if @app_id.to_s.length < 1
    invalid_properties.push('invalid value for "app_id", the character length must be great than or equal to 1.')
  end

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

  if @app_name.to_s.length < 1
    invalid_properties.push('invalid value for "app_name", the character length must be great than or equal to 1.')
  end

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

  if @app_type.to_s.length < 1
    invalid_properties.push('invalid value for "app_type", the character length must be great than or equal to 1.')
  end

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

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

  if @integration_alias.to_s.length < 1
    invalid_properties.push('invalid value for "integration_alias", the character length must be great than or equal to 1.')
  end

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

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

  if @integration_name.to_s.length < 1
    invalid_properties.push('invalid value for "integration_name", the character length must be great than or equal to 1.')
  end

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

  if @item_id.to_s.length < 1
    invalid_properties.push('invalid value for "item_id", the character length must be great than or equal to 1.')
  end

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

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

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

  if @status.to_s.length < 1
    invalid_properties.push('invalid value for "status", the character length must be great than or equal to 1.')
  end

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

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

  if @status_reason.to_s.length < 1
    invalid_properties.push('invalid value for "status_reason", the character length must be great than or equal to 1.')
  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



569
570
571
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 569

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



575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 575

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



563
564
565
# File 'lib/crimson-falcon/models/app_app_inventory.rb', line 563

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



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

def valid?
  return false if @access_level.nil?
  return false if @access_level.to_s.length < 1
  return false if @account_id.nil?
  return false if @app_id.nil?
  return false if @app_id.to_s.length < 1
  return false if @app_name.nil?
  return false if @app_name.to_s.length < 1
  return false if @app_type.nil?
  return false if @app_type.to_s.length < 1
  return false if @created.nil?
  return false if @integration_alias.nil?
  return false if @integration_alias.to_s.length < 1
  return false if @integration_id.nil?
  return false if @integration_name.nil?
  return false if @integration_name.to_s.length < 1
  return false if @item_id.nil?
  return false if @item_id.to_s.length < 1
  return false if @last_activity.nil?
  return false if @scopes.nil?
  return false if @status.nil?
  return false if @status.to_s.length < 1
  return false if @status_expiration_date.nil?
  return false if @status_reason.nil?
  return false if @status_reason.to_s.length < 1
  true
end