Class: OneSignal::App

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

Defined Under Namespace

Classes: EnumAttributeValidator

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



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
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
358
359
360
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
# File 'lib/onesignal/models/app.rb', line 237

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#additional_data_is_root_payloadObject

iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you’re not using any other plugins, or not using OneSignal SDK methods to read the payload.



105
106
107
# File 'lib/onesignal/models/app.rb', line 105

def additional_data_is_root_payload
  @additional_data_is_root_payload
end

#android_gcm_sender_idObject

Android: Your Google Project number. Also known as Sender ID.



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

def android_gcm_sender_id
  @android_gcm_sender_id
end

#apns_bundle_idObject

iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem.



75
76
77
# File 'lib/onesignal/models/app.rb', line 75

def apns_bundle_id
  @apns_bundle_id
end

#apns_certificatesObject

Returns the value of attribute apns_certificates.



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

def apns_certificates
  @apns_certificates
end

#apns_envObject

iOS: Either sandbox or production



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

def apns_env
  @apns_env
end

#apns_key_idObject

iOS: Required if using p8. Unique identifier for the p8 authentication key.



69
70
71
# File 'lib/onesignal/models/app.rb', line 69

def apns_key_id
  @apns_key_id
end

#apns_p12Object

iOS: Your apple push notification p12 certificate file, converted to a string and Base64 encoded.



53
54
55
# File 'lib/onesignal/models/app.rb', line 53

def apns_p12
  @apns_p12
end

#apns_p12_passwordObject

iOS: Required if using p12 certificate. Password for the apns_p12 file.



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

def apns_p12_password
  @apns_p12_password
end

#apns_p8Object

iOS: Required if using p8. Base64 encoded p8 key



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

def apns_p8
  @apns_p8
end

#apns_team_idObject

iOS: Required if using p8. Team ID generated by Apple for your developer account.



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

def apns_team_id
  @apns_team_id
end

#basic_auth_keyObject

Returns the value of attribute basic_auth_key.



99
100
101
# File 'lib/onesignal/models/app.rb', line 99

def basic_auth_key
  @basic_auth_key
end

#chrome_keyObject

Not for web push. Your Google Push Messaging Auth Key if you use Chrome Apps / Extensions.



41
42
43
# File 'lib/onesignal/models/app.rb', line 41

def chrome_key
  @chrome_key
end

#chrome_web_default_notification_iconObject

Chrome (All Browsers except Safari): Your default notification icon. Should be 256x256 pixels, min 80x80.



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

def chrome_web_default_notification_icon
  @chrome_web_default_notification_icon
end

#chrome_web_originObject

Chrome (All Browsers except Safari) (Recommended): The URL to your website. This field is required if you wish to enable web push and specify other web push parameters.



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

def chrome_web_origin
  @chrome_web_origin
end

#chrome_web_sub_domainObject

Chrome (All Browsers except Safari): A subdomain of your choice in order to support Web Push on non-HTTPS websites. This field must be set in order for the chrome_web_gcm_sender_id property to be processed.



47
48
49
# File 'lib/onesignal/models/app.rb', line 47

def chrome_web_sub_domain
  @chrome_web_sub_domain
end

#created_atObject

Returns the value of attribute created_at.



29
30
31
# File 'lib/onesignal/models/app.rb', line 29

def created_at
  @created_at
end

#gcm_keyObject

Android: Your Google Push Messaging Auth Key



35
36
37
# File 'lib/onesignal/models/app.rb', line 35

def gcm_key
  @gcm_key
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#messageable_playersObject

Returns the value of attribute messageable_players.



25
26
27
# File 'lib/onesignal/models/app.rb', line 25

def messageable_players
  @messageable_players
end

#nameObject

The name of your app, as displayed on your apps list on the dashboard. This can be renamed.



21
22
23
# File 'lib/onesignal/models/app.rb', line 21

def name
  @name
end

#organization_idObject

The Id of the Organization you would like to add this app to.



102
103
104
# File 'lib/onesignal/models/app.rb', line 102

def organization_id
  @organization_id
end

#playersObject

Returns the value of attribute players.



23
24
25
# File 'lib/onesignal/models/app.rb', line 23

def players
  @players
end

#safari_apns_certificatesObject

Returns the value of attribute safari_apns_certificates.



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

def safari_apns_certificates
  @safari_apns_certificates
end

#safari_apns_p12Object

Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded.



63
64
65
# File 'lib/onesignal/models/app.rb', line 63

def safari_apns_p12
  @safari_apns_p12
end

#safari_apns_p12_passwordObject

Safari: Password for safari_apns_p12 file



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

def safari_apns_p12_password
  @safari_apns_p12_password
end

#safari_icon_128_128Object

Returns the value of attribute safari_icon_128_128.



91
92
93
# File 'lib/onesignal/models/app.rb', line 91

def safari_icon_128_128
  @safari_icon_128_128
end

#safari_icon_16_16Object

Returns the value of attribute safari_icon_16_16.



85
86
87
# File 'lib/onesignal/models/app.rb', line 85

def safari_icon_16_16
  @safari_icon_16_16
end

#safari_icon_256_256Object

Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide.



94
95
96
# File 'lib/onesignal/models/app.rb', line 94

def safari_icon_256_256
  @safari_icon_256_256
end

#safari_icon_32_32Object

Returns the value of attribute safari_icon_32_32.



87
88
89
# File 'lib/onesignal/models/app.rb', line 87

def safari_icon_32_32
  @safari_icon_32_32
end

#safari_icon_64_64Object

Returns the value of attribute safari_icon_64_64.



89
90
91
# File 'lib/onesignal/models/app.rb', line 89

def safari_icon_64_64
  @safari_icon_64_64
end

#safari_push_idObject

Returns the value of attribute safari_push_id.



83
84
85
# File 'lib/onesignal/models/app.rb', line 83

def safari_push_id
  @safari_push_id
end

#safari_site_originObject

Safari (Recommended): The hostname to your website including http(s)://



81
82
83
# File 'lib/onesignal/models/app.rb', line 81

def safari_site_origin
  @safari_site_origin
end

#site_nameObject

All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it.



97
98
99
# File 'lib/onesignal/models/app.rb', line 97

def site_name
  @site_name
end

#updated_atObject

Returns the value of attribute updated_at.



27
28
29
# File 'lib/onesignal/models/app.rb', line 27

def updated_at
  @updated_at
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



170
171
172
# File 'lib/onesignal/models/app.rb', line 170

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'players' => :'players',
    :'messageable_players' => :'messageable_players',
    :'updated_at' => :'updated_at',
    :'created_at' => :'created_at',
    :'android_gcm_sender_id' => :'android_gcm_sender_id',
    :'gcm_key' => :'gcm_key',
    :'chrome_web_origin' => :'chrome_web_origin',
    :'chrome_key' => :'chrome_key',
    :'chrome_web_default_notification_icon' => :'chrome_web_default_notification_icon',
    :'chrome_web_sub_domain' => :'chrome_web_sub_domain',
    :'apns_env' => :'apns_env',
    :'apns_p12' => :'apns_p12',
    :'apns_p12_password' => :'apns_p12_password',
    :'apns_certificates' => :'apns_certificates',
    :'safari_apns_certificates' => :'safari_apns_certificates',
    :'safari_apns_p12' => :'safari_apns_p12',
    :'safari_apns_p12_password' => :'safari_apns_p12_password',
    :'apns_key_id' => :'apns_key_id',
    :'apns_team_id' => :'apns_team_id',
    :'apns_bundle_id' => :'apns_bundle_id',
    :'apns_p8' => :'apns_p8',
    :'safari_site_origin' => :'safari_site_origin',
    :'safari_push_id' => :'safari_push_id',
    :'safari_icon_16_16' => :'safari_icon_16_16',
    :'safari_icon_32_32' => :'safari_icon_32_32',
    :'safari_icon_64_64' => :'safari_icon_64_64',
    :'safari_icon_128_128' => :'safari_icon_128_128',
    :'safari_icon_256_256' => :'safari_icon_256_256',
    :'site_name' => :'site_name',
    :'basic_auth_key' => :'basic_auth_key',
    :'organization_id' => :'organization_id',
    :'additional_data_is_root_payload' => :'additional_data_is_root_payload'
  }
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



468
469
470
# File 'lib/onesignal/models/app.rb', line 468

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

.openapi_nullableObject

List of attributes with nullable: true



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/onesignal/models/app.rb', line 215

def self.openapi_nullable
  Set.new([
    :'gcm_key',
    :'chrome_web_origin',
    :'chrome_key',
    :'chrome_web_default_notification_icon',
    :'chrome_web_sub_domain',
    :'apns_env',
    :'apns_certificates',
    :'apns_key_id',
    :'apns_team_id',
    :'apns_bundle_id',
    :'apns_p8',
    :'safari_site_origin',
    :'safari_push_id',
    :'site_name',
    :'basic_auth_key',
  ])
end

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'id' => :'String',
    :'name' => :'String',
    :'players' => :'Integer',
    :'messageable_players' => :'Integer',
    :'updated_at' => :'Time',
    :'created_at' => :'Time',
    :'android_gcm_sender_id' => :'String',
    :'gcm_key' => :'String',
    :'chrome_web_origin' => :'String',
    :'chrome_key' => :'String',
    :'chrome_web_default_notification_icon' => :'String',
    :'chrome_web_sub_domain' => :'String',
    :'apns_env' => :'String',
    :'apns_p12' => :'String',
    :'apns_p12_password' => :'String',
    :'apns_certificates' => :'String',
    :'safari_apns_certificates' => :'String',
    :'safari_apns_p12' => :'String',
    :'safari_apns_p12_password' => :'String',
    :'apns_key_id' => :'String',
    :'apns_team_id' => :'String',
    :'apns_bundle_id' => :'String',
    :'apns_p8' => :'String',
    :'safari_site_origin' => :'String',
    :'safari_push_id' => :'String',
    :'safari_icon_16_16' => :'String',
    :'safari_icon_32_32' => :'String',
    :'safari_icon_64_64' => :'String',
    :'safari_icon_128_128' => :'String',
    :'safari_icon_256_256' => :'String',
    :'site_name' => :'String',
    :'basic_auth_key' => :'String',
    :'organization_id' => :'String',
    :'additional_data_is_root_payload' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
443
444
445
446
447
448
449
450
451
# File 'lib/onesignal/models/app.rb', line 414

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      players == o.players &&
      messageable_players == o.messageable_players &&
      updated_at == o.updated_at &&
      created_at == o.created_at &&
      android_gcm_sender_id == o.android_gcm_sender_id &&
      gcm_key == o.gcm_key &&
      chrome_web_origin == o.chrome_web_origin &&
      chrome_key == o.chrome_key &&
      chrome_web_default_notification_icon == o.chrome_web_default_notification_icon &&
      chrome_web_sub_domain == o.chrome_web_sub_domain &&
      apns_env == o.apns_env &&
      apns_p12 == o.apns_p12 &&
      apns_p12_password == o.apns_p12_password &&
      apns_certificates == o.apns_certificates &&
      safari_apns_certificates == o.safari_apns_certificates &&
      safari_apns_p12 == o.safari_apns_p12 &&
      safari_apns_p12_password == o.safari_apns_p12_password &&
      apns_key_id == o.apns_key_id &&
      apns_team_id == o.apns_team_id &&
      apns_bundle_id == o.apns_bundle_id &&
      apns_p8 == o.apns_p8 &&
      safari_site_origin == o.safari_site_origin &&
      safari_push_id == o.safari_push_id &&
      safari_icon_16_16 == o.safari_icon_16_16 &&
      safari_icon_32_32 == o.safari_icon_32_32 &&
      safari_icon_64_64 == o.safari_icon_64_64 &&
      safari_icon_128_128 == o.safari_icon_128_128 &&
      safari_icon_256_256 == o.safari_icon_256_256 &&
      site_name == o.site_name &&
      basic_auth_key == o.basic_auth_key &&
      organization_id == o.organization_id &&
      additional_data_is_root_payload == o.additional_data_is_root_payload
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



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/onesignal/models/app.rb', line 499

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 = OneSignal.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



570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/onesignal/models/app.rb', line 570

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



475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/onesignal/models/app.rb', line 475

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


455
456
457
# File 'lib/onesignal/models/app.rb', line 455

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



461
462
463
# File 'lib/onesignal/models/app.rb', line 461

def hash
  [id, name, players, messageable_players, updated_at, created_at, android_gcm_sender_id, gcm_key, chrome_web_origin, chrome_key, chrome_web_default_notification_icon, chrome_web_sub_domain, apns_env, apns_p12, apns_p12_password, apns_certificates, safari_apns_certificates, safari_apns_p12, safari_apns_p12_password, apns_key_id, apns_team_id, apns_bundle_id, apns_p8, safari_site_origin, safari_push_id, safari_icon_16_16, safari_icon_32_32, safari_icon_64_64, safari_icon_128_128, safari_icon_256_256, site_name, basic_auth_key, organization_id, additional_data_is_root_payload].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



389
390
391
392
# File 'lib/onesignal/models/app.rb', line 389

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



546
547
548
# File 'lib/onesignal/models/app.rb', line 546

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



552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/onesignal/models/app.rb', line 552

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



540
541
542
# File 'lib/onesignal/models/app.rb', line 540

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



396
397
398
399
400
# File 'lib/onesignal/models/app.rb', line 396

def valid?
  apns_env_validator = EnumAttributeValidator.new('String', ["sandbox", "production"])
  return false unless apns_env_validator.valid?(@apns_env)
  true
end