notifo-io 1.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +163 -0
  4. data/Rakefile +10 -0
  5. data/docs/AddAllowedTopicRequest.md +18 -0
  6. data/docs/AddContributorDto.md +20 -0
  7. data/docs/AppContributorDto.md +22 -0
  8. data/docs/AppDetailsDto.md +48 -0
  9. data/docs/AppDto.md +28 -0
  10. data/docs/AppsApi.md +646 -0
  11. data/docs/ConfigsApi.md +127 -0
  12. data/docs/ConfirmMode.md +15 -0
  13. data/docs/CreateEmailTemplateDto.md +18 -0
  14. data/docs/EmailTemplateDto.md +22 -0
  15. data/docs/EmailVerificationStatus.md +15 -0
  16. data/docs/ErrorDto.md +26 -0
  17. data/docs/EventDto.md +40 -0
  18. data/docs/EventsApi.md +142 -0
  19. data/docs/InlineObject.md +18 -0
  20. data/docs/IsoDayOfWeek.md +15 -0
  21. data/docs/ListResponseDtoOfEventDto.md +20 -0
  22. data/docs/ListResponseDtoOfLogEntryDto.md +20 -0
  23. data/docs/ListResponseDtoOfMediaDto.md +20 -0
  24. data/docs/ListResponseDtoOfSubscriptionDto.md +20 -0
  25. data/docs/ListResponseDtoOfTemplateDto.md +20 -0
  26. data/docs/ListResponseDtoOfTopicDto.md +20 -0
  27. data/docs/ListResponseDtoOfUserDto.md +20 -0
  28. data/docs/LogEntryDto.md +24 -0
  29. data/docs/LogsApi.md +78 -0
  30. data/docs/MediaApi.md +295 -0
  31. data/docs/MediaDto.md +28 -0
  32. data/docs/MediaType.md +15 -0
  33. data/docs/NotificationFormattingDto.md +32 -0
  34. data/docs/NotificationSettingDto.md +20 -0
  35. data/docs/PublishManyRequestDto.md +18 -0
  36. data/docs/PublishRequestDto.md +36 -0
  37. data/docs/ResizeMode.md +15 -0
  38. data/docs/SchedulingDto.md +24 -0
  39. data/docs/SchedulingType.md +15 -0
  40. data/docs/SubscribeDto.md +20 -0
  41. data/docs/SubscriptionDto.md +20 -0
  42. data/docs/TemplateDto.md +22 -0
  43. data/docs/TemplatesApi.md +208 -0
  44. data/docs/TopicDto.md +22 -0
  45. data/docs/TopicsApi.md +270 -0
  46. data/docs/UpsertAppDto.md +36 -0
  47. data/docs/UpsertTemplateDto.md +22 -0
  48. data/docs/UpsertTemplatesDto.md +18 -0
  49. data/docs/UpsertUserDto.md +32 -0
  50. data/docs/UpsertUsersDto.md +18 -0
  51. data/docs/UserDto.md +36 -0
  52. data/docs/UsersApi.md +610 -0
  53. data/git_push.sh +58 -0
  54. data/lib/notifo.rb +87 -0
  55. data/lib/notifo/api/apps_api.rb +678 -0
  56. data/lib/notifo/api/configs_api.rb +132 -0
  57. data/lib/notifo/api/events_api.rb +161 -0
  58. data/lib/notifo/api/logs_api.rb +92 -0
  59. data/lib/notifo/api/media_api.rb +322 -0
  60. data/lib/notifo/api/templates_api.rb +228 -0
  61. data/lib/notifo/api/topics_api.rb +281 -0
  62. data/lib/notifo/api/users_api.rb +667 -0
  63. data/lib/notifo/api_client.rb +389 -0
  64. data/lib/notifo/api_error.rb +57 -0
  65. data/lib/notifo/configuration.rb +268 -0
  66. data/lib/notifo/models/add_allowed_topic_request.rb +219 -0
  67. data/lib/notifo/models/add_contributor_dto.rb +229 -0
  68. data/lib/notifo/models/app_contributor_dto.rb +239 -0
  69. data/lib/notifo/models/app_details_dto.rb +381 -0
  70. data/lib/notifo/models/app_dto.rb +273 -0
  71. data/lib/notifo/models/confirm_mode.rb +38 -0
  72. data/lib/notifo/models/create_email_template_dto.rb +219 -0
  73. data/lib/notifo/models/email_template_dto.rb +240 -0
  74. data/lib/notifo/models/email_verification_status.rb +39 -0
  75. data/lib/notifo/models/error_dto.rb +265 -0
  76. data/lib/notifo/models/event_dto.rb +333 -0
  77. data/lib/notifo/models/inline_object.rb +219 -0
  78. data/lib/notifo/models/iso_day_of_week.rb +43 -0
  79. data/lib/notifo/models/list_response_dto_of_event_dto.rb +231 -0
  80. data/lib/notifo/models/list_response_dto_of_log_entry_dto.rb +231 -0
  81. data/lib/notifo/models/list_response_dto_of_media_dto.rb +231 -0
  82. data/lib/notifo/models/list_response_dto_of_subscription_dto.rb +231 -0
  83. data/lib/notifo/models/list_response_dto_of_template_dto.rb +231 -0
  84. data/lib/notifo/models/list_response_dto_of_topic_dto.rb +231 -0
  85. data/lib/notifo/models/list_response_dto_of_user_dto.rb +231 -0
  86. data/lib/notifo/models/log_entry_dto.rb +249 -0
  87. data/lib/notifo/models/media_dto.rb +269 -0
  88. data/lib/notifo/models/media_type.rb +39 -0
  89. data/lib/notifo/models/notification_formatting_dto.rb +295 -0
  90. data/lib/notifo/models/notification_setting_dto.rb +231 -0
  91. data/lib/notifo/models/publish_many_request_dto.rb +221 -0
  92. data/lib/notifo/models/publish_request_dto.rb +315 -0
  93. data/lib/notifo/models/resize_mode.rb +42 -0
  94. data/lib/notifo/models/scheduling_dto.rb +251 -0
  95. data/lib/notifo/models/scheduling_type.rb +37 -0
  96. data/lib/notifo/models/subscribe_dto.rb +229 -0
  97. data/lib/notifo/models/subscription_dto.rb +229 -0
  98. data/lib/notifo/models/template_dto.rb +239 -0
  99. data/lib/notifo/models/topic_dto.rb +239 -0
  100. data/lib/notifo/models/upsert_app_dto.rb +321 -0
  101. data/lib/notifo/models/upsert_template_dto.rb +240 -0
  102. data/lib/notifo/models/upsert_templates_dto.rb +221 -0
  103. data/lib/notifo/models/upsert_user_dto.rb +297 -0
  104. data/lib/notifo/models/upsert_users_dto.rb +221 -0
  105. data/lib/notifo/models/user_dto.rb +309 -0
  106. data/lib/notifo/version.rb +15 -0
  107. data/notifo-io-1.0.0.gem +0 -0
  108. data/notifo-io-1.0.0.pre.beta.gem +0 -0
  109. data/notifo.gemspec +38 -0
  110. data/spec/api/apps_api_spec.rb +151 -0
  111. data/spec/api/configs_api_spec.rb +55 -0
  112. data/spec/api/events_api_spec.rb +61 -0
  113. data/spec/api/logs_api_spec.rb +49 -0
  114. data/spec/api/media_api_spec.rb +95 -0
  115. data/spec/api/templates_api_spec.rb +73 -0
  116. data/spec/api/topics_api_spec.rb +85 -0
  117. data/spec/api/users_api_spec.rb +152 -0
  118. data/spec/api_client_spec.rb +226 -0
  119. data/spec/configuration_spec.rb +42 -0
  120. data/spec/models/add_allowed_topic_request_spec.rb +34 -0
  121. data/spec/models/add_contributor_dto_spec.rb +40 -0
  122. data/spec/models/app_contributor_dto_spec.rb +46 -0
  123. data/spec/models/app_details_dto_spec.rb +124 -0
  124. data/spec/models/app_dto_spec.rb +64 -0
  125. data/spec/models/confirm_mode_spec.rb +28 -0
  126. data/spec/models/create_email_template_dto_spec.rb +34 -0
  127. data/spec/models/email_template_dto_spec.rb +46 -0
  128. data/spec/models/email_verification_status_spec.rb +28 -0
  129. data/spec/models/error_dto_spec.rb +58 -0
  130. data/spec/models/event_dto_spec.rb +100 -0
  131. data/spec/models/inline_object_spec.rb +34 -0
  132. data/spec/models/iso_day_of_week_spec.rb +28 -0
  133. data/spec/models/list_response_dto_of_event_dto_spec.rb +40 -0
  134. data/spec/models/list_response_dto_of_log_entry_dto_spec.rb +40 -0
  135. data/spec/models/list_response_dto_of_media_dto_spec.rb +40 -0
  136. data/spec/models/list_response_dto_of_subscription_dto_spec.rb +40 -0
  137. data/spec/models/list_response_dto_of_template_dto_spec.rb +40 -0
  138. data/spec/models/list_response_dto_of_topic_dto_spec.rb +40 -0
  139. data/spec/models/list_response_dto_of_user_dto_spec.rb +40 -0
  140. data/spec/models/log_entry_dto_spec.rb +52 -0
  141. data/spec/models/media_dto_spec.rb +64 -0
  142. data/spec/models/media_type_spec.rb +28 -0
  143. data/spec/models/notification_formatting_dto_spec.rb +76 -0
  144. data/spec/models/notification_setting_dto_spec.rb +40 -0
  145. data/spec/models/publish_many_request_dto_spec.rb +34 -0
  146. data/spec/models/publish_request_dto_spec.rb +88 -0
  147. data/spec/models/resize_mode_spec.rb +28 -0
  148. data/spec/models/scheduling_dto_spec.rb +52 -0
  149. data/spec/models/scheduling_type_spec.rb +28 -0
  150. data/spec/models/subscribe_dto_spec.rb +40 -0
  151. data/spec/models/subscription_dto_spec.rb +40 -0
  152. data/spec/models/template_dto_spec.rb +46 -0
  153. data/spec/models/topic_dto_spec.rb +46 -0
  154. data/spec/models/upsert_app_dto_spec.rb +88 -0
  155. data/spec/models/upsert_template_dto_spec.rb +46 -0
  156. data/spec/models/upsert_templates_dto_spec.rb +34 -0
  157. data/spec/models/upsert_user_dto_spec.rb +76 -0
  158. data/spec/models/upsert_users_dto_spec.rb +34 -0
  159. data/spec/models/user_dto_spec.rb +88 -0
  160. data/spec/spec_helper.rb +111 -0
  161. metadata +294 -0
@@ -0,0 +1,381 @@
1
+ =begin
2
+ #Notifo API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Notifo
17
+ class AppDetailsDto
18
+ # The id of the app.
19
+ attr_accessor :id
20
+
21
+ # The app name.
22
+ attr_accessor :name
23
+
24
+ # The current role.
25
+ attr_accessor :role
26
+
27
+ # The supported languages.
28
+ attr_accessor :languages
29
+
30
+ # The sender email address.
31
+ attr_accessor :email_address
32
+
33
+ # The sender email name.
34
+ attr_accessor :email_name
35
+
36
+ # The firebase project ID.
37
+ attr_accessor :firebase_project
38
+
39
+ # The firebase credentials.
40
+ attr_accessor :firebase_credential
41
+
42
+ # The webhook URL.
43
+ attr_accessor :webhook_url
44
+
45
+ # The confirm URL.
46
+ attr_accessor :confirm_url
47
+
48
+ # True, when emails are allowed.
49
+ attr_accessor :allow_email
50
+
51
+ # True, when SMS are allowed.
52
+ attr_accessor :allow_sms
53
+
54
+ # The verification status of the email.
55
+ attr_accessor :email_verification_status
56
+
57
+ # The api keys.
58
+ attr_accessor :api_keys
59
+
60
+ # The contributors.
61
+ attr_accessor :contributors
62
+
63
+ # The statistics counters.
64
+ attr_accessor :counters
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'id' => :'id',
70
+ :'name' => :'name',
71
+ :'role' => :'role',
72
+ :'languages' => :'languages',
73
+ :'email_address' => :'emailAddress',
74
+ :'email_name' => :'emailName',
75
+ :'firebase_project' => :'firebaseProject',
76
+ :'firebase_credential' => :'firebaseCredential',
77
+ :'webhook_url' => :'webhookUrl',
78
+ :'confirm_url' => :'confirmUrl',
79
+ :'allow_email' => :'allowEmail',
80
+ :'allow_sms' => :'allowSms',
81
+ :'email_verification_status' => :'emailVerificationStatus',
82
+ :'api_keys' => :'apiKeys',
83
+ :'contributors' => :'contributors',
84
+ :'counters' => :'counters'
85
+ }
86
+ end
87
+
88
+ # Returns all the JSON keys this model knows about
89
+ def self.acceptable_attributes
90
+ attribute_map.values
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.openapi_types
95
+ {
96
+ :'id' => :'String',
97
+ :'name' => :'String',
98
+ :'role' => :'String',
99
+ :'languages' => :'Array<String>',
100
+ :'email_address' => :'String',
101
+ :'email_name' => :'String',
102
+ :'firebase_project' => :'String',
103
+ :'firebase_credential' => :'String',
104
+ :'webhook_url' => :'String',
105
+ :'confirm_url' => :'String',
106
+ :'allow_email' => :'Boolean',
107
+ :'allow_sms' => :'Boolean',
108
+ :'email_verification_status' => :'OneOfEmailVerificationStatus',
109
+ :'api_keys' => :'Hash<String, String>',
110
+ :'contributors' => :'Array<AppContributorDto>',
111
+ :'counters' => :'OneOfmap'
112
+ }
113
+ end
114
+
115
+ # List of attributes with nullable: true
116
+ def self.openapi_nullable
117
+ Set.new([
118
+ :'email_address',
119
+ :'email_name',
120
+ :'firebase_project',
121
+ :'firebase_credential',
122
+ :'webhook_url',
123
+ :'confirm_url',
124
+ ])
125
+ end
126
+
127
+ # Initializes the object
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ def initialize(attributes = {})
130
+ if (!attributes.is_a?(Hash))
131
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::AppDetailsDto` initialize method"
132
+ end
133
+
134
+ # check to see if the attribute exists and convert string to symbol for hash key
135
+ attributes = attributes.each_with_object({}) { |(k, v), h|
136
+ if (!self.class.attribute_map.key?(k.to_sym))
137
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::AppDetailsDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
138
+ end
139
+ h[k.to_sym] = v
140
+ }
141
+
142
+ if attributes.key?(:'id')
143
+ self.id = attributes[:'id']
144
+ end
145
+
146
+ if attributes.key?(:'name')
147
+ self.name = attributes[:'name']
148
+ end
149
+
150
+ if attributes.key?(:'role')
151
+ self.role = attributes[:'role']
152
+ end
153
+
154
+ if attributes.key?(:'languages')
155
+ if (value = attributes[:'languages']).is_a?(Array)
156
+ self.languages = value
157
+ end
158
+ end
159
+
160
+ if attributes.key?(:'email_address')
161
+ self.email_address = attributes[:'email_address']
162
+ end
163
+
164
+ if attributes.key?(:'email_name')
165
+ self.email_name = attributes[:'email_name']
166
+ end
167
+
168
+ if attributes.key?(:'firebase_project')
169
+ self.firebase_project = attributes[:'firebase_project']
170
+ end
171
+
172
+ if attributes.key?(:'firebase_credential')
173
+ self.firebase_credential = attributes[:'firebase_credential']
174
+ end
175
+
176
+ if attributes.key?(:'webhook_url')
177
+ self.webhook_url = attributes[:'webhook_url']
178
+ end
179
+
180
+ if attributes.key?(:'confirm_url')
181
+ self.confirm_url = attributes[:'confirm_url']
182
+ end
183
+
184
+ if attributes.key?(:'allow_email')
185
+ self.allow_email = attributes[:'allow_email']
186
+ end
187
+
188
+ if attributes.key?(:'allow_sms')
189
+ self.allow_sms = attributes[:'allow_sms']
190
+ end
191
+
192
+ if attributes.key?(:'email_verification_status')
193
+ self.email_verification_status = attributes[:'email_verification_status']
194
+ end
195
+
196
+ if attributes.key?(:'api_keys')
197
+ if (value = attributes[:'api_keys']).is_a?(Hash)
198
+ self.api_keys = value
199
+ end
200
+ end
201
+
202
+ if attributes.key?(:'contributors')
203
+ if (value = attributes[:'contributors']).is_a?(Array)
204
+ self.contributors = value
205
+ end
206
+ end
207
+
208
+ if attributes.key?(:'counters')
209
+ self.counters = attributes[:'counters']
210
+ end
211
+ end
212
+
213
+ # Show invalid properties with the reasons. Usually used together with valid?
214
+ # @return Array for valid properties with the reasons
215
+ def list_invalid_properties
216
+ invalid_properties = Array.new
217
+ invalid_properties
218
+ end
219
+
220
+ # Check to see if the all the properties in the model are valid
221
+ # @return true if the model is valid
222
+ def valid?
223
+ true
224
+ end
225
+
226
+ # Checks equality by comparing each attribute.
227
+ # @param [Object] Object to be compared
228
+ def ==(o)
229
+ return true if self.equal?(o)
230
+ self.class == o.class &&
231
+ id == o.id &&
232
+ name == o.name &&
233
+ role == o.role &&
234
+ languages == o.languages &&
235
+ email_address == o.email_address &&
236
+ email_name == o.email_name &&
237
+ firebase_project == o.firebase_project &&
238
+ firebase_credential == o.firebase_credential &&
239
+ webhook_url == o.webhook_url &&
240
+ confirm_url == o.confirm_url &&
241
+ allow_email == o.allow_email &&
242
+ allow_sms == o.allow_sms &&
243
+ email_verification_status == o.email_verification_status &&
244
+ api_keys == o.api_keys &&
245
+ contributors == o.contributors &&
246
+ counters == o.counters
247
+ end
248
+
249
+ # @see the `==` method
250
+ # @param [Object] Object to be compared
251
+ def eql?(o)
252
+ self == o
253
+ end
254
+
255
+ # Calculates hash code according to all attributes.
256
+ # @return [Integer] Hash code
257
+ def hash
258
+ [id, name, role, languages, email_address, email_name, firebase_project, firebase_credential, webhook_url, confirm_url, allow_email, allow_sms, email_verification_status, api_keys, contributors, counters].hash
259
+ end
260
+
261
+ # Builds the object from hash
262
+ # @param [Hash] attributes Model attributes in the form of hash
263
+ # @return [Object] Returns the model itself
264
+ def self.build_from_hash(attributes)
265
+ new.build_from_hash(attributes)
266
+ end
267
+
268
+ # Builds the object from hash
269
+ # @param [Hash] attributes Model attributes in the form of hash
270
+ # @return [Object] Returns the model itself
271
+ def build_from_hash(attributes)
272
+ return nil unless attributes.is_a?(Hash)
273
+ self.class.openapi_types.each_pair do |key, type|
274
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
275
+ self.send("#{key}=", nil)
276
+ elsif type =~ /\AArray<(.*)>/i
277
+ # check to ensure the input is an array given that the attribute
278
+ # is documented as an array but the input is not
279
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
280
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
281
+ end
282
+ elsif !attributes[self.class.attribute_map[key]].nil?
283
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
284
+ end
285
+ end
286
+
287
+ self
288
+ end
289
+
290
+ # Deserializes the data based on type
291
+ # @param string type Data type
292
+ # @param string value Value to be deserialized
293
+ # @return [Object] Deserialized data
294
+ def _deserialize(type, value)
295
+ case type.to_sym
296
+ when :Time
297
+ Time.parse(value)
298
+ when :Date
299
+ Date.parse(value)
300
+ when :String
301
+ value.to_s
302
+ when :Integer
303
+ value.to_i
304
+ when :Float
305
+ value.to_f
306
+ when :Boolean
307
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
308
+ true
309
+ else
310
+ false
311
+ end
312
+ when :Object
313
+ # generic object (usually a Hash), return directly
314
+ value
315
+ when /\AArray<(?<inner_type>.+)>\z/
316
+ inner_type = Regexp.last_match[:inner_type]
317
+ value.map { |v| _deserialize(inner_type, v) }
318
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
319
+ k_type = Regexp.last_match[:k_type]
320
+ v_type = Regexp.last_match[:v_type]
321
+ {}.tap do |hash|
322
+ value.each do |k, v|
323
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
324
+ end
325
+ end
326
+ else # model
327
+ # models (e.g. Pet) or oneOf
328
+ klass = Notifo.const_get(type)
329
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
330
+ end
331
+ end
332
+
333
+ # Returns the string representation of the object
334
+ # @return [String] String presentation of the object
335
+ def to_s
336
+ to_hash.to_s
337
+ end
338
+
339
+ # to_body is an alias to to_hash (backward compatibility)
340
+ # @return [Hash] Returns the object in the form of hash
341
+ def to_body
342
+ to_hash
343
+ end
344
+
345
+ # Returns the object in the form of hash
346
+ # @return [Hash] Returns the object in the form of hash
347
+ def to_hash
348
+ hash = {}
349
+ self.class.attribute_map.each_pair do |attr, param|
350
+ value = self.send(attr)
351
+ if value.nil?
352
+ is_nullable = self.class.openapi_nullable.include?(attr)
353
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
354
+ end
355
+
356
+ hash[param] = _to_hash(value)
357
+ end
358
+ hash
359
+ end
360
+
361
+ # Outputs non-array value in the form of hash
362
+ # For object, use to_hash. Otherwise, just return the value
363
+ # @param [Object] value Any valid value
364
+ # @return [Hash] Returns the value in the form of hash
365
+ def _to_hash(value)
366
+ if value.is_a?(Array)
367
+ value.compact.map { |v| _to_hash(v) }
368
+ elsif value.is_a?(Hash)
369
+ {}.tap do |hash|
370
+ value.each { |k, v| hash[k] = _to_hash(v) }
371
+ end
372
+ elsif value.respond_to? :to_hash
373
+ value.to_hash
374
+ else
375
+ value
376
+ end
377
+ end
378
+
379
+ end
380
+
381
+ end
@@ -0,0 +1,273 @@
1
+ =begin
2
+ #Notifo API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Notifo
17
+ class AppDto
18
+ # The id of the app.
19
+ attr_accessor :id
20
+
21
+ # The app name.
22
+ attr_accessor :name
23
+
24
+ # The current role.
25
+ attr_accessor :role
26
+
27
+ # The supported languages.
28
+ attr_accessor :languages
29
+
30
+ # The api keys.
31
+ attr_accessor :api_keys
32
+
33
+ # The statistics counters.
34
+ attr_accessor :counters
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'id' => :'id',
40
+ :'name' => :'name',
41
+ :'role' => :'role',
42
+ :'languages' => :'languages',
43
+ :'api_keys' => :'apiKeys',
44
+ :'counters' => :'counters'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'id' => :'String',
57
+ :'name' => :'String',
58
+ :'role' => :'String',
59
+ :'languages' => :'Array<String>',
60
+ :'api_keys' => :'Hash<String, String>',
61
+ :'counters' => :'OneOfmap'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::AppDto` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::AppDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'id')
87
+ self.id = attributes[:'id']
88
+ end
89
+
90
+ if attributes.key?(:'name')
91
+ self.name = attributes[:'name']
92
+ end
93
+
94
+ if attributes.key?(:'role')
95
+ self.role = attributes[:'role']
96
+ end
97
+
98
+ if attributes.key?(:'languages')
99
+ if (value = attributes[:'languages']).is_a?(Array)
100
+ self.languages = value
101
+ end
102
+ end
103
+
104
+ if attributes.key?(:'api_keys')
105
+ if (value = attributes[:'api_keys']).is_a?(Hash)
106
+ self.api_keys = value
107
+ end
108
+ end
109
+
110
+ if attributes.key?(:'counters')
111
+ self.counters = attributes[:'counters']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ true
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ id == o.id &&
134
+ name == o.name &&
135
+ role == o.role &&
136
+ languages == o.languages &&
137
+ api_keys == o.api_keys &&
138
+ counters == o.counters
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ def hash
150
+ [id, name, role, languages, api_keys, counters].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def self.build_from_hash(attributes)
157
+ new.build_from_hash(attributes)
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ self.class.openapi_types.each_pair do |key, type|
166
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
167
+ self.send("#{key}=", nil)
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
172
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
173
+ end
174
+ elsif !attributes[self.class.attribute_map[key]].nil?
175
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
176
+ end
177
+ end
178
+
179
+ self
180
+ end
181
+
182
+ # Deserializes the data based on type
183
+ # @param string type Data type
184
+ # @param string value Value to be deserialized
185
+ # @return [Object] Deserialized data
186
+ def _deserialize(type, value)
187
+ case type.to_sym
188
+ when :Time
189
+ Time.parse(value)
190
+ when :Date
191
+ Date.parse(value)
192
+ when :String
193
+ value.to_s
194
+ when :Integer
195
+ value.to_i
196
+ when :Float
197
+ value.to_f
198
+ when :Boolean
199
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
200
+ true
201
+ else
202
+ false
203
+ end
204
+ when :Object
205
+ # generic object (usually a Hash), return directly
206
+ value
207
+ when /\AArray<(?<inner_type>.+)>\z/
208
+ inner_type = Regexp.last_match[:inner_type]
209
+ value.map { |v| _deserialize(inner_type, v) }
210
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
211
+ k_type = Regexp.last_match[:k_type]
212
+ v_type = Regexp.last_match[:v_type]
213
+ {}.tap do |hash|
214
+ value.each do |k, v|
215
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
216
+ end
217
+ end
218
+ else # model
219
+ # models (e.g. Pet) or oneOf
220
+ klass = Notifo.const_get(type)
221
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
222
+ end
223
+ end
224
+
225
+ # Returns the string representation of the object
226
+ # @return [String] String presentation of the object
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+
231
+ # to_body is an alias to to_hash (backward compatibility)
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_body
234
+ to_hash
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ self.class.attribute_map.each_pair do |attr, param|
242
+ value = self.send(attr)
243
+ if value.nil?
244
+ is_nullable = self.class.openapi_nullable.include?(attr)
245
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
246
+ end
247
+
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ # Outputs non-array value in the form of hash
254
+ # For object, use to_hash. Otherwise, just return the value
255
+ # @param [Object] value Any valid value
256
+ # @return [Hash] Returns the value in the form of hash
257
+ def _to_hash(value)
258
+ if value.is_a?(Array)
259
+ value.compact.map { |v| _to_hash(v) }
260
+ elsif value.is_a?(Hash)
261
+ {}.tap do |hash|
262
+ value.each { |k, v| hash[k] = _to_hash(v) }
263
+ end
264
+ elsif value.respond_to? :to_hash
265
+ value.to_hash
266
+ else
267
+ value
268
+ end
269
+ end
270
+
271
+ end
272
+
273
+ end