Class: stcloud::App

Inherits:
Object
  • Object
show all
Defined in:
lib/stcloud/models/app.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ App

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/stcloud/models/app.rb', line 164

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#ajax_thresholdObject

Returns the value of attribute ajax_threshold.



16
17
18
# File 'lib/stcloud/models/app.rb', line 16

def ajax_threshold
  @ajax_threshold
end

#app_typeObject

Returns the value of attribute app_type.



18
19
20
# File 'lib/stcloud/models/app.rb', line 18

def app_type
  @app_type
end

#app_type_idObject

Returns the value of attribute app_type_id.



20
21
22
# File 'lib/stcloud/models/app.rb', line 20

def app_type_id
  @app_type_id
end

#creator_emailObject

Returns the value of attribute creator_email.



22
23
24
# File 'lib/stcloud/models/app.rb', line 22

def creator_email
  @creator_email
end

#credit_card_expiryObject

Returns the value of attribute credit_card_expiry.



24
25
26
# File 'lib/stcloud/models/app.rb', line 24

def credit_card_expiry
  @credit_card_expiry
end

#credit_card_numberObject

Returns the value of attribute credit_card_number.



26
27
28
# File 'lib/stcloud/models/app.rb', line 26

def credit_card_number
  @credit_card_number
end

#descriptionObject

Returns the value of attribute description.



28
29
30
# File 'lib/stcloud/models/app.rb', line 28

def description
  @description
end

#display_statusObject

Returns the value of attribute display_status.



30
31
32
# File 'lib/stcloud/models/app.rb', line 30

def display_status
  @display_status
end

#first_data_saved_dateObject

Returns the value of attribute first_data_saved_date.



32
33
34
# File 'lib/stcloud/models/app.rb', line 32

def first_data_saved_date
  @first_data_saved_date
end

#idObject

Returns the value of attribute id.



34
35
36
# File 'lib/stcloud/models/app.rb', line 34

def id
  @id
end

#integrationObject

Returns the value of attribute integration.



36
37
38
# File 'lib/stcloud/models/app.rb', line 36

def integration
  @integration
end

#last_data_received_dateObject

Returns the value of attribute last_data_received_date.



38
39
40
# File 'lib/stcloud/models/app.rb', line 38

def last_data_received_date
  @last_data_received_date
end

#last_data_saved_dateObject

Returns the value of attribute last_data_saved_date.



40
41
42
# File 'lib/stcloud/models/app.rb', line 40

def last_data_saved_date
  @last_data_saved_date
end

#logged_in_user_app_roleObject

Returns the value of attribute logged_in_user_app_role.



42
43
44
# File 'lib/stcloud/models/app.rb', line 42

def logged_in_user_app_role
  @logged_in_user_app_role
end

#monthly_invoice_accountObject

Returns the value of attribute monthly_invoice_account.



44
45
46
# File 'lib/stcloud/models/app.rb', line 44

def 
  @monthly_invoice_account
end

#nameObject

Returns the value of attribute name.



46
47
48
# File 'lib/stcloud/models/app.rb', line 46

def name
  @name
end

#owner_emailObject

Returns the value of attribute owner_email.



48
49
50
# File 'lib/stcloud/models/app.rb', line 48

def owner_email
  @owner_email
end

#owning_organizationObject

Returns the value of attribute owning_organization.



50
51
52
# File 'lib/stcloud/models/app.rb', line 50

def owning_organization
  @owning_organization
end

#page_load_thresholdObject

Returns the value of attribute page_load_threshold.



52
53
54
# File 'lib/stcloud/models/app.rb', line 52

def page_load_threshold
  @page_load_threshold
end

#payment_method_idObject

Returns the value of attribute payment_method_id.



54
55
56
# File 'lib/stcloud/models/app.rb', line 54

def payment_method_id
  @payment_method_id
end

#planObject

Returns the value of attribute plan.



56
57
58
# File 'lib/stcloud/models/app.rb', line 56

def plan
  @plan
end

#prepaid_accountObject

Returns the value of attribute prepaid_account.



58
59
60
# File 'lib/stcloud/models/app.rb', line 58

def 
  @prepaid_account
end

#read_tokenObject

Returns the value of attribute read_token.



60
61
62
# File 'lib/stcloud/models/app.rb', line 60

def read_token
  @read_token
end

#read_write_tokenObject

Returns the value of attribute read_write_token.



62
63
64
# File 'lib/stcloud/models/app.rb', line 62

def read_write_token
  @read_write_token
end

#registration_dateObject

Returns the value of attribute registration_date.



64
65
66
# File 'lib/stcloud/models/app.rb', line 64

def registration_date
  @registration_date
end

#statusObject

Returns the value of attribute status.



66
67
68
# File 'lib/stcloud/models/app.rb', line 66

def status
  @status
end

#tokenObject

Returns the value of attribute token.



68
69
70
# File 'lib/stcloud/models/app.rb', line 68

def token
  @token
end

#tokensObject

Returns the value of attribute tokens.



70
71
72
# File 'lib/stcloud/models/app.rb', line 70

def tokens
  @tokens
end

#trial_end_dateObject

Returns the value of attribute trial_end_date.



72
73
74
# File 'lib/stcloud/models/app.rb', line 72

def trial_end_date
  @trial_end_date
end

#url_group_limitObject

Returns the value of attribute url_group_limit.



74
75
76
# File 'lib/stcloud/models/app.rb', line 74

def url_group_limit
  @url_group_limit
end

#user_rolesObject

Returns the value of attribute user_roles.



76
77
78
# File 'lib/stcloud/models/app.rb', line 76

def user_roles
  @user_roles
end

#write_tokenObject

Returns the value of attribute write_token.



78
79
80
# File 'lib/stcloud/models/app.rb', line 78

def write_token
  @write_token
end

Class Method Details

.attribute_mapObject

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



81
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
109
110
111
112
113
114
115
116
# File 'lib/stcloud/models/app.rb', line 81

def self.attribute_map
  {
    :'ajax_threshold' => :'ajaxThreshold',
    :'app_type' => :'appType',
    :'app_type_id' => :'appTypeId',
    :'creator_email' => :'creatorEmail',
    :'credit_card_expiry' => :'creditCardExpiry',
    :'credit_card_number' => :'creditCardNumber',
    :'description' => :'description',
    :'display_status' => :'displayStatus',
    :'first_data_saved_date' => :'firstDataSavedDate',
    :'id' => :'id',
    :'integration' => :'integration',
    :'last_data_received_date' => :'lastDataReceivedDate',
    :'last_data_saved_date' => :'lastDataSavedDate',
    :'logged_in_user_app_role' => :'loggedInUserAppRole',
    :'monthly_invoice_account' => :'monthlyInvoiceAccount',
    :'name' => :'name',
    :'owner_email' => :'ownerEmail',
    :'owning_organization' => :'owningOrganization',
    :'page_load_threshold' => :'pageLoadThreshold',
    :'payment_method_id' => :'paymentMethodId',
    :'plan' => :'plan',
    :'prepaid_account' => :'prepaidAccount',
    :'read_token' => :'readToken',
    :'read_write_token' => :'readWriteToken',
    :'registration_date' => :'registrationDate',
    :'status' => :'status',
    :'token' => :'token',
    :'tokens' => :'tokens',
    :'trial_end_date' => :'trialEndDate',
    :'url_group_limit' => :'urlGroupLimit',
    :'user_roles' => :'userRoles',
    :'write_token' => :'writeToken'
  }
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



377
378
379
# File 'lib/stcloud/models/app.rb', line 377

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

.openapi_nullableObject

List of attributes with nullable: true



157
158
159
160
# File 'lib/stcloud/models/app.rb', line 157

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
149
150
151
152
153
154
# File 'lib/stcloud/models/app.rb', line 119

def self.openapi_types
  {
    :'ajax_threshold' => :'Object',
    :'app_type' => :'Object',
    :'app_type_id' => :'Object',
    :'creator_email' => :'Object',
    :'credit_card_expiry' => :'Object',
    :'credit_card_number' => :'Object',
    :'description' => :'Object',
    :'display_status' => :'Object',
    :'first_data_saved_date' => :'Object',
    :'id' => :'Object',
    :'integration' => :'Object',
    :'last_data_received_date' => :'Object',
    :'last_data_saved_date' => :'Object',
    :'logged_in_user_app_role' => :'Object',
    :'monthly_invoice_account' => :'Object',
    :'name' => :'Object',
    :'owner_email' => :'Object',
    :'owning_organization' => :'Object',
    :'page_load_threshold' => :'Object',
    :'payment_method_id' => :'Object',
    :'plan' => :'Object',
    :'prepaid_account' => :'Object',
    :'read_token' => :'Object',
    :'read_write_token' => :'Object',
    :'registration_date' => :'Object',
    :'status' => :'Object',
    :'token' => :'Object',
    :'tokens' => :'Object',
    :'trial_end_date' => :'Object',
    :'url_group_limit' => :'Object',
    :'user_roles' => :'Object',
    :'write_token' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/stcloud/models/app.rb', line 325

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ajax_threshold == o.ajax_threshold &&
      app_type == o.app_type &&
      app_type_id == o.app_type_id &&
      creator_email == o.creator_email &&
      credit_card_expiry == o.credit_card_expiry &&
      credit_card_number == o.credit_card_number &&
      description == o.description &&
      display_status == o.display_status &&
      first_data_saved_date == o.first_data_saved_date &&
      id == o.id &&
      integration == o.integration &&
      last_data_received_date == o.last_data_received_date &&
      last_data_saved_date == o.last_data_saved_date &&
      logged_in_user_app_role == o.logged_in_user_app_role &&
       == o. &&
      name == o.name &&
      owner_email == o.owner_email &&
      owning_organization == o.owning_organization &&
      page_load_threshold == o.page_load_threshold &&
      payment_method_id == o.payment_method_id &&
      plan == o.plan &&
       == o. &&
      read_token == o.read_token &&
      read_write_token == o.read_write_token &&
      registration_date == o.registration_date &&
      status == o.status &&
      token == o.token &&
      tokens == o.tokens &&
      trial_end_date == o.trial_end_date &&
      url_group_limit == o.url_group_limit &&
      user_roles == o.user_roles &&
      write_token == o.write_token
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



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/stcloud/models/app.rb', line 407

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
    stcloud.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



476
477
478
479
480
481
482
483
484
485
486
487
488
# File 'lib/stcloud/models/app.rb', line 476

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



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/stcloud/models/app.rb', line 384

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


364
365
366
# File 'lib/stcloud/models/app.rb', line 364

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



370
371
372
# File 'lib/stcloud/models/app.rb', line 370

def hash
  [ajax_threshold, app_type, app_type_id, creator_email, credit_card_expiry, credit_card_number, description, display_status, first_data_saved_date, id, integration, last_data_received_date, last_data_saved_date, logged_in_user_app_role, , name, owner_email, owning_organization, page_load_threshold, payment_method_id, plan, , read_token, read_write_token, registration_date, status, token, tokens, trial_end_date, url_group_limit, user_roles, write_token].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



312
313
314
315
# File 'lib/stcloud/models/app.rb', line 312

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



452
453
454
# File 'lib/stcloud/models/app.rb', line 452

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



458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/stcloud/models/app.rb', line 458

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



446
447
448
# File 'lib/stcloud/models/app.rb', line 446

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



319
320
321
# File 'lib/stcloud/models/app.rb', line 319

def valid?
  true
end