notifo-io-easierlife 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +167 -0
  4. data/Rakefile +10 -0
  5. data/docs/AddAllowedTopicDto.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/IsoDayOfWeek.md +15 -0
  20. data/docs/ListResponseDtoOfEventDto.md +20 -0
  21. data/docs/ListResponseDtoOfLogEntryDto.md +20 -0
  22. data/docs/ListResponseDtoOfMediaDto.md +20 -0
  23. data/docs/ListResponseDtoOfSubscriptionDto.md +20 -0
  24. data/docs/ListResponseDtoOfTemplateDto.md +20 -0
  25. data/docs/ListResponseDtoOfTopicDto.md +20 -0
  26. data/docs/ListResponseDtoOfUserDto.md +20 -0
  27. data/docs/LogEntryDto.md +24 -0
  28. data/docs/LogsApi.md +78 -0
  29. data/docs/MediaApi.md +382 -0
  30. data/docs/MediaDto.md +30 -0
  31. data/docs/MediaType.md +15 -0
  32. data/docs/NotificationFormattingDto.md +32 -0
  33. data/docs/NotificationSend.md +15 -0
  34. data/docs/NotificationSettingDto.md +20 -0
  35. data/docs/ProfileDto.md +32 -0
  36. data/docs/PublishDto.md +36 -0
  37. data/docs/PublishManyDto.md +18 -0
  38. data/docs/ResizeMode.md +15 -0
  39. data/docs/SchedulingDto.md +24 -0
  40. data/docs/SchedulingType.md +15 -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 +78 -0
  46. data/docs/UpdateProfileDto.md +28 -0
  47. data/docs/UpsertAppDto.md +36 -0
  48. data/docs/UpsertTemplateDto.md +22 -0
  49. data/docs/UpsertTemplatesDto.md +18 -0
  50. data/docs/UpsertUserDto.md +32 -0
  51. data/docs/UpsertUsersDto.md +18 -0
  52. data/docs/UserApi.md +323 -0
  53. data/docs/UserDto.md +36 -0
  54. data/docs/UsersApi.md +610 -0
  55. data/git_push.sh +58 -0
  56. data/lib/notifo.rb +89 -0
  57. data/lib/notifo/api/apps_api.rb +678 -0
  58. data/lib/notifo/api/configs_api.rb +132 -0
  59. data/lib/notifo/api/events_api.rb +161 -0
  60. data/lib/notifo/api/logs_api.rb +92 -0
  61. data/lib/notifo/api/media_api.rb +419 -0
  62. data/lib/notifo/api/templates_api.rb +228 -0
  63. data/lib/notifo/api/topics_api.rb +92 -0
  64. data/lib/notifo/api/user_api.rb +331 -0
  65. data/lib/notifo/api/users_api.rb +667 -0
  66. data/lib/notifo/api_client.rb +389 -0
  67. data/lib/notifo/api_error.rb +57 -0
  68. data/lib/notifo/configuration.rb +270 -0
  69. data/lib/notifo/models/add_allowed_topic_dto.rb +243 -0
  70. data/lib/notifo/models/add_contributor_dto.rb +277 -0
  71. data/lib/notifo/models/app_contributor_dto.rb +311 -0
  72. data/lib/notifo/models/app_details_dto.rb +489 -0
  73. data/lib/notifo/models/app_dto.rb +362 -0
  74. data/lib/notifo/models/confirm_mode.rb +38 -0
  75. data/lib/notifo/models/create_email_template_dto.rb +243 -0
  76. data/lib/notifo/models/email_template_dto.rb +288 -0
  77. data/lib/notifo/models/email_verification_status.rb +39 -0
  78. data/lib/notifo/models/error_dto.rb +265 -0
  79. data/lib/notifo/models/event_dto.rb +456 -0
  80. data/lib/notifo/models/iso_day_of_week.rb +43 -0
  81. data/lib/notifo/models/list_response_dto_of_event_dto.rb +241 -0
  82. data/lib/notifo/models/list_response_dto_of_log_entry_dto.rb +241 -0
  83. data/lib/notifo/models/list_response_dto_of_media_dto.rb +241 -0
  84. data/lib/notifo/models/list_response_dto_of_subscription_dto.rb +241 -0
  85. data/lib/notifo/models/list_response_dto_of_template_dto.rb +241 -0
  86. data/lib/notifo/models/list_response_dto_of_topic_dto.rb +241 -0
  87. data/lib/notifo/models/list_response_dto_of_user_dto.rb +241 -0
  88. data/lib/notifo/models/log_entry_dto.rb +326 -0
  89. data/lib/notifo/models/media_dto.rb +390 -0
  90. data/lib/notifo/models/media_type.rb +39 -0
  91. data/lib/notifo/models/notification_formatting_dto.rb +305 -0
  92. data/lib/notifo/models/notification_send.rb +39 -0
  93. data/lib/notifo/models/notification_setting_dto.rb +234 -0
  94. data/lib/notifo/models/profile_dto.rb +361 -0
  95. data/lib/notifo/models/publish_dto.rb +338 -0
  96. data/lib/notifo/models/publish_many_dto.rb +226 -0
  97. data/lib/notifo/models/resize_mode.rb +42 -0
  98. data/lib/notifo/models/scheduling_dto.rb +248 -0
  99. data/lib/notifo/models/scheduling_type.rb +37 -0
  100. data/lib/notifo/models/subscription_dto.rb +256 -0
  101. data/lib/notifo/models/template_dto.rb +274 -0
  102. data/lib/notifo/models/topic_dto.rb +294 -0
  103. data/lib/notifo/models/update_profile_dto.rb +277 -0
  104. data/lib/notifo/models/upsert_app_dto.rb +321 -0
  105. data/lib/notifo/models/upsert_template_dto.rb +270 -0
  106. data/lib/notifo/models/upsert_templates_dto.rb +226 -0
  107. data/lib/notifo/models/upsert_user_dto.rb +299 -0
  108. data/lib/notifo/models/upsert_users_dto.rb +226 -0
  109. data/lib/notifo/models/user_dto.rb +381 -0
  110. data/lib/notifo/version.rb +15 -0
  111. data/notifo-io-1.0.0.gem +0 -0
  112. data/notifo.gemspec +38 -0
  113. data/spec/api/apps_api_spec.rb +151 -0
  114. data/spec/api/configs_api_spec.rb +55 -0
  115. data/spec/api/events_api_spec.rb +61 -0
  116. data/spec/api/logs_api_spec.rb +49 -0
  117. data/spec/api/media_api_spec.rb +117 -0
  118. data/spec/api/templates_api_spec.rb +73 -0
  119. data/spec/api/topics_api_spec.rb +49 -0
  120. data/spec/api/user_api_spec.rb +92 -0
  121. data/spec/api/users_api_spec.rb +152 -0
  122. data/spec/api_client_spec.rb +226 -0
  123. data/spec/configuration_spec.rb +42 -0
  124. data/spec/models/add_allowed_topic_dto_spec.rb +34 -0
  125. data/spec/models/add_contributor_dto_spec.rb +40 -0
  126. data/spec/models/app_contributor_dto_spec.rb +46 -0
  127. data/spec/models/app_details_dto_spec.rb +124 -0
  128. data/spec/models/app_dto_spec.rb +64 -0
  129. data/spec/models/confirm_mode_spec.rb +28 -0
  130. data/spec/models/create_email_template_dto_spec.rb +34 -0
  131. data/spec/models/email_template_dto_spec.rb +46 -0
  132. data/spec/models/email_verification_status_spec.rb +28 -0
  133. data/spec/models/error_dto_spec.rb +58 -0
  134. data/spec/models/event_dto_spec.rb +100 -0
  135. data/spec/models/iso_day_of_week_spec.rb +28 -0
  136. data/spec/models/list_response_dto_of_event_dto_spec.rb +40 -0
  137. data/spec/models/list_response_dto_of_log_entry_dto_spec.rb +40 -0
  138. data/spec/models/list_response_dto_of_media_dto_spec.rb +40 -0
  139. data/spec/models/list_response_dto_of_subscription_dto_spec.rb +40 -0
  140. data/spec/models/list_response_dto_of_template_dto_spec.rb +40 -0
  141. data/spec/models/list_response_dto_of_topic_dto_spec.rb +40 -0
  142. data/spec/models/list_response_dto_of_user_dto_spec.rb +40 -0
  143. data/spec/models/log_entry_dto_spec.rb +52 -0
  144. data/spec/models/media_dto_spec.rb +70 -0
  145. data/spec/models/media_type_spec.rb +28 -0
  146. data/spec/models/notification_formatting_dto_spec.rb +76 -0
  147. data/spec/models/notification_send_spec.rb +28 -0
  148. data/spec/models/notification_setting_dto_spec.rb +40 -0
  149. data/spec/models/profile_dto_spec.rb +76 -0
  150. data/spec/models/publish_dto_spec.rb +88 -0
  151. data/spec/models/publish_many_dto_spec.rb +34 -0
  152. data/spec/models/resize_mode_spec.rb +28 -0
  153. data/spec/models/scheduling_dto_spec.rb +52 -0
  154. data/spec/models/scheduling_type_spec.rb +28 -0
  155. data/spec/models/subscription_dto_spec.rb +40 -0
  156. data/spec/models/template_dto_spec.rb +46 -0
  157. data/spec/models/topic_dto_spec.rb +46 -0
  158. data/spec/models/update_profile_dto_spec.rb +64 -0
  159. data/spec/models/upsert_app_dto_spec.rb +88 -0
  160. data/spec/models/upsert_template_dto_spec.rb +46 -0
  161. data/spec/models/upsert_templates_dto_spec.rb +34 -0
  162. data/spec/models/upsert_user_dto_spec.rb +76 -0
  163. data/spec/models/upsert_users_dto_spec.rb +34 -0
  164. data/spec/models/user_dto_spec.rb +88 -0
  165. data/spec/spec_helper.rb +111 -0
  166. metadata +301 -0
@@ -0,0 +1,311 @@
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.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Notifo
17
+ class AppContributorDto
18
+ # The id of the user.
19
+ attr_accessor :user_id
20
+
21
+ # The name of the user.
22
+ attr_accessor :user_name
23
+
24
+ # The role.
25
+ attr_accessor :role
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'user_id' => :'userId',
31
+ :'user_name' => :'userName',
32
+ :'role' => :'role'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'user_id' => :'String',
45
+ :'user_name' => :'String',
46
+ :'role' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::AppContributorDto` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::AppContributorDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'user_id')
72
+ self.user_id = attributes[:'user_id']
73
+ end
74
+
75
+ if attributes.key?(:'user_name')
76
+ self.user_name = attributes[:'user_name']
77
+ end
78
+
79
+ if attributes.key?(:'role')
80
+ self.role = attributes[:'role']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ if @user_id.nil?
89
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
90
+ end
91
+
92
+ if @user_id.to_s.length < 1
93
+ invalid_properties.push('invalid value for "user_id", the character length must be great than or equal to 1.')
94
+ end
95
+
96
+ if @user_name.nil?
97
+ invalid_properties.push('invalid value for "user_name", user_name cannot be nil.')
98
+ end
99
+
100
+ if @user_name.to_s.length < 1
101
+ invalid_properties.push('invalid value for "user_name", the character length must be great than or equal to 1.')
102
+ end
103
+
104
+ if @role.nil?
105
+ invalid_properties.push('invalid value for "role", role cannot be nil.')
106
+ end
107
+
108
+ if @role.to_s.length < 1
109
+ invalid_properties.push('invalid value for "role", the character length must be great than or equal to 1.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ return false if @user_id.nil?
119
+ return false if @user_id.to_s.length < 1
120
+ return false if @user_name.nil?
121
+ return false if @user_name.to_s.length < 1
122
+ return false if @role.nil?
123
+ return false if @role.to_s.length < 1
124
+ true
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] user_id Value to be assigned
129
+ def user_id=(user_id)
130
+ if user_id.nil?
131
+ fail ArgumentError, 'user_id cannot be nil'
132
+ end
133
+
134
+ if user_id.to_s.length < 1
135
+ fail ArgumentError, 'invalid value for "user_id", the character length must be great than or equal to 1.'
136
+ end
137
+
138
+ @user_id = user_id
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] user_name Value to be assigned
143
+ def user_name=(user_name)
144
+ if user_name.nil?
145
+ fail ArgumentError, 'user_name cannot be nil'
146
+ end
147
+
148
+ if user_name.to_s.length < 1
149
+ fail ArgumentError, 'invalid value for "user_name", the character length must be great than or equal to 1.'
150
+ end
151
+
152
+ @user_name = user_name
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] role Value to be assigned
157
+ def role=(role)
158
+ if role.nil?
159
+ fail ArgumentError, 'role cannot be nil'
160
+ end
161
+
162
+ if role.to_s.length < 1
163
+ fail ArgumentError, 'invalid value for "role", the character length must be great than or equal to 1.'
164
+ end
165
+
166
+ @role = role
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] Object to be compared
171
+ def ==(o)
172
+ return true if self.equal?(o)
173
+ self.class == o.class &&
174
+ user_id == o.user_id &&
175
+ user_name == o.user_name &&
176
+ role == o.role
177
+ end
178
+
179
+ # @see the `==` method
180
+ # @param [Object] Object to be compared
181
+ def eql?(o)
182
+ self == o
183
+ end
184
+
185
+ # Calculates hash code according to all attributes.
186
+ # @return [Integer] Hash code
187
+ def hash
188
+ [user_id, user_name, role].hash
189
+ end
190
+
191
+ # Builds the object from hash
192
+ # @param [Hash] attributes Model attributes in the form of hash
193
+ # @return [Object] Returns the model itself
194
+ def self.build_from_hash(attributes)
195
+ new.build_from_hash(attributes)
196
+ end
197
+
198
+ # Builds the object from hash
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ # @return [Object] Returns the model itself
201
+ def build_from_hash(attributes)
202
+ return nil unless attributes.is_a?(Hash)
203
+ self.class.openapi_types.each_pair do |key, type|
204
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
205
+ self.send("#{key}=", nil)
206
+ elsif type =~ /\AArray<(.*)>/i
207
+ # check to ensure the input is an array given that the attribute
208
+ # is documented as an array but the input is not
209
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
210
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
211
+ end
212
+ elsif !attributes[self.class.attribute_map[key]].nil?
213
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
214
+ end
215
+ end
216
+
217
+ self
218
+ end
219
+
220
+ # Deserializes the data based on type
221
+ # @param string type Data type
222
+ # @param string value Value to be deserialized
223
+ # @return [Object] Deserialized data
224
+ def _deserialize(type, value)
225
+ case type.to_sym
226
+ when :Time
227
+ Time.parse(value)
228
+ when :Date
229
+ Date.parse(value)
230
+ when :String
231
+ value.to_s
232
+ when :Integer
233
+ value.to_i
234
+ when :Float
235
+ value.to_f
236
+ when :Boolean
237
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
238
+ true
239
+ else
240
+ false
241
+ end
242
+ when :Object
243
+ # generic object (usually a Hash), return directly
244
+ value
245
+ when /\AArray<(?<inner_type>.+)>\z/
246
+ inner_type = Regexp.last_match[:inner_type]
247
+ value.map { |v| _deserialize(inner_type, v) }
248
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
249
+ k_type = Regexp.last_match[:k_type]
250
+ v_type = Regexp.last_match[:v_type]
251
+ {}.tap do |hash|
252
+ value.each do |k, v|
253
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
254
+ end
255
+ end
256
+ else # model
257
+ # models (e.g. Pet) or oneOf
258
+ klass = Notifo.const_get(type)
259
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
260
+ end
261
+ end
262
+
263
+ # Returns the string representation of the object
264
+ # @return [String] String presentation of the object
265
+ def to_s
266
+ to_hash.to_s
267
+ end
268
+
269
+ # to_body is an alias to to_hash (backward compatibility)
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_body
272
+ to_hash
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ self.class.attribute_map.each_pair do |attr, param|
280
+ value = self.send(attr)
281
+ if value.nil?
282
+ is_nullable = self.class.openapi_nullable.include?(attr)
283
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
284
+ end
285
+
286
+ hash[param] = _to_hash(value)
287
+ end
288
+ hash
289
+ end
290
+
291
+ # Outputs non-array value in the form of hash
292
+ # For object, use to_hash. Otherwise, just return the value
293
+ # @param [Object] value Any valid value
294
+ # @return [Hash] Returns the value in the form of hash
295
+ def _to_hash(value)
296
+ if value.is_a?(Array)
297
+ value.compact.map { |v| _to_hash(v) }
298
+ elsif value.is_a?(Hash)
299
+ {}.tap do |hash|
300
+ value.each { |k, v| hash[k] = _to_hash(v) }
301
+ end
302
+ elsif value.respond_to? :to_hash
303
+ value.to_hash
304
+ else
305
+ value
306
+ end
307
+ end
308
+
309
+ end
310
+
311
+ end
@@ -0,0 +1,489 @@
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.1.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
+ attr_accessor :email_verification_status
55
+
56
+ # The api keys.
57
+ attr_accessor :api_keys
58
+
59
+ # The contributors.
60
+ attr_accessor :contributors
61
+
62
+ # The statistics counters.
63
+ attr_accessor :counters
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'id' => :'id',
69
+ :'name' => :'name',
70
+ :'role' => :'role',
71
+ :'languages' => :'languages',
72
+ :'email_address' => :'emailAddress',
73
+ :'email_name' => :'emailName',
74
+ :'firebase_project' => :'firebaseProject',
75
+ :'firebase_credential' => :'firebaseCredential',
76
+ :'webhook_url' => :'webhookUrl',
77
+ :'confirm_url' => :'confirmUrl',
78
+ :'allow_email' => :'allowEmail',
79
+ :'allow_sms' => :'allowSms',
80
+ :'email_verification_status' => :'emailVerificationStatus',
81
+ :'api_keys' => :'apiKeys',
82
+ :'contributors' => :'contributors',
83
+ :'counters' => :'counters'
84
+ }
85
+ end
86
+
87
+ # Returns all the JSON keys this model knows about
88
+ def self.acceptable_attributes
89
+ attribute_map.values
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'id' => :'String',
96
+ :'name' => :'String',
97
+ :'role' => :'String',
98
+ :'languages' => :'Array<String>',
99
+ :'email_address' => :'String',
100
+ :'email_name' => :'String',
101
+ :'firebase_project' => :'String',
102
+ :'firebase_credential' => :'String',
103
+ :'webhook_url' => :'String',
104
+ :'confirm_url' => :'String',
105
+ :'allow_email' => :'Boolean',
106
+ :'allow_sms' => :'Boolean',
107
+ :'email_verification_status' => :'EmailVerificationStatus',
108
+ :'api_keys' => :'Hash<String, String>',
109
+ :'contributors' => :'Array<AppContributorDto>',
110
+ :'counters' => :'Hash<String, Integer>'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ :'email_address',
118
+ :'email_name',
119
+ :'firebase_project',
120
+ :'firebase_credential',
121
+ :'webhook_url',
122
+ :'confirm_url',
123
+ ])
124
+ end
125
+
126
+ # Initializes the object
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ def initialize(attributes = {})
129
+ if (!attributes.is_a?(Hash))
130
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::AppDetailsDto` initialize method"
131
+ end
132
+
133
+ # check to see if the attribute exists and convert string to symbol for hash key
134
+ attributes = attributes.each_with_object({}) { |(k, v), h|
135
+ if (!self.class.attribute_map.key?(k.to_sym))
136
+ 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
137
+ end
138
+ h[k.to_sym] = v
139
+ }
140
+
141
+ if attributes.key?(:'id')
142
+ self.id = attributes[:'id']
143
+ end
144
+
145
+ if attributes.key?(:'name')
146
+ self.name = attributes[:'name']
147
+ end
148
+
149
+ if attributes.key?(:'role')
150
+ self.role = attributes[:'role']
151
+ end
152
+
153
+ if attributes.key?(:'languages')
154
+ if (value = attributes[:'languages']).is_a?(Array)
155
+ self.languages = value
156
+ end
157
+ end
158
+
159
+ if attributes.key?(:'email_address')
160
+ self.email_address = attributes[:'email_address']
161
+ end
162
+
163
+ if attributes.key?(:'email_name')
164
+ self.email_name = attributes[:'email_name']
165
+ end
166
+
167
+ if attributes.key?(:'firebase_project')
168
+ self.firebase_project = attributes[:'firebase_project']
169
+ end
170
+
171
+ if attributes.key?(:'firebase_credential')
172
+ self.firebase_credential = attributes[:'firebase_credential']
173
+ end
174
+
175
+ if attributes.key?(:'webhook_url')
176
+ self.webhook_url = attributes[:'webhook_url']
177
+ end
178
+
179
+ if attributes.key?(:'confirm_url')
180
+ self.confirm_url = attributes[:'confirm_url']
181
+ end
182
+
183
+ if attributes.key?(:'allow_email')
184
+ self.allow_email = attributes[:'allow_email']
185
+ end
186
+
187
+ if attributes.key?(:'allow_sms')
188
+ self.allow_sms = attributes[:'allow_sms']
189
+ end
190
+
191
+ if attributes.key?(:'email_verification_status')
192
+ self.email_verification_status = attributes[:'email_verification_status']
193
+ end
194
+
195
+ if attributes.key?(:'api_keys')
196
+ if (value = attributes[:'api_keys']).is_a?(Hash)
197
+ self.api_keys = value
198
+ end
199
+ end
200
+
201
+ if attributes.key?(:'contributors')
202
+ if (value = attributes[:'contributors']).is_a?(Array)
203
+ self.contributors = value
204
+ end
205
+ end
206
+
207
+ if attributes.key?(:'counters')
208
+ if (value = attributes[:'counters']).is_a?(Hash)
209
+ self.counters = value
210
+ end
211
+ end
212
+ end
213
+
214
+ # Show invalid properties with the reasons. Usually used together with valid?
215
+ # @return Array for valid properties with the reasons
216
+ def list_invalid_properties
217
+ invalid_properties = Array.new
218
+ if @id.nil?
219
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
220
+ end
221
+
222
+ if @id.to_s.length < 1
223
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.')
224
+ end
225
+
226
+ if @name.nil?
227
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
228
+ end
229
+
230
+ if @name.to_s.length < 1
231
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
232
+ end
233
+
234
+ if @role.nil?
235
+ invalid_properties.push('invalid value for "role", role cannot be nil.')
236
+ end
237
+
238
+ if @role.to_s.length < 1
239
+ invalid_properties.push('invalid value for "role", the character length must be great than or equal to 1.')
240
+ end
241
+
242
+ if @languages.nil?
243
+ invalid_properties.push('invalid value for "languages", languages cannot be nil.')
244
+ end
245
+
246
+ if @allow_email.nil?
247
+ invalid_properties.push('invalid value for "allow_email", allow_email cannot be nil.')
248
+ end
249
+
250
+ if @allow_sms.nil?
251
+ invalid_properties.push('invalid value for "allow_sms", allow_sms cannot be nil.')
252
+ end
253
+
254
+ if @email_verification_status.nil?
255
+ invalid_properties.push('invalid value for "email_verification_status", email_verification_status cannot be nil.')
256
+ end
257
+
258
+ if @api_keys.nil?
259
+ invalid_properties.push('invalid value for "api_keys", api_keys cannot be nil.')
260
+ end
261
+
262
+ if @contributors.nil?
263
+ invalid_properties.push('invalid value for "contributors", contributors cannot be nil.')
264
+ end
265
+
266
+ if @counters.nil?
267
+ invalid_properties.push('invalid value for "counters", counters cannot be nil.')
268
+ end
269
+
270
+ invalid_properties
271
+ end
272
+
273
+ # Check to see if the all the properties in the model are valid
274
+ # @return true if the model is valid
275
+ def valid?
276
+ return false if @id.nil?
277
+ return false if @id.to_s.length < 1
278
+ return false if @name.nil?
279
+ return false if @name.to_s.length < 1
280
+ return false if @role.nil?
281
+ return false if @role.to_s.length < 1
282
+ return false if @languages.nil?
283
+ return false if @allow_email.nil?
284
+ return false if @allow_sms.nil?
285
+ return false if @email_verification_status.nil?
286
+ return false if @api_keys.nil?
287
+ return false if @contributors.nil?
288
+ return false if @counters.nil?
289
+ true
290
+ end
291
+
292
+ # Custom attribute writer method with validation
293
+ # @param [Object] id Value to be assigned
294
+ def id=(id)
295
+ if id.nil?
296
+ fail ArgumentError, 'id cannot be nil'
297
+ end
298
+
299
+ if id.to_s.length < 1
300
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.'
301
+ end
302
+
303
+ @id = id
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] name Value to be assigned
308
+ def name=(name)
309
+ if name.nil?
310
+ fail ArgumentError, 'name cannot be nil'
311
+ end
312
+
313
+ if name.to_s.length < 1
314
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
315
+ end
316
+
317
+ @name = name
318
+ end
319
+
320
+ # Custom attribute writer method with validation
321
+ # @param [Object] role Value to be assigned
322
+ def role=(role)
323
+ if role.nil?
324
+ fail ArgumentError, 'role cannot be nil'
325
+ end
326
+
327
+ if role.to_s.length < 1
328
+ fail ArgumentError, 'invalid value for "role", the character length must be great than or equal to 1.'
329
+ end
330
+
331
+ @role = role
332
+ end
333
+
334
+ # Checks equality by comparing each attribute.
335
+ # @param [Object] Object to be compared
336
+ def ==(o)
337
+ return true if self.equal?(o)
338
+ self.class == o.class &&
339
+ id == o.id &&
340
+ name == o.name &&
341
+ role == o.role &&
342
+ languages == o.languages &&
343
+ email_address == o.email_address &&
344
+ email_name == o.email_name &&
345
+ firebase_project == o.firebase_project &&
346
+ firebase_credential == o.firebase_credential &&
347
+ webhook_url == o.webhook_url &&
348
+ confirm_url == o.confirm_url &&
349
+ allow_email == o.allow_email &&
350
+ allow_sms == o.allow_sms &&
351
+ email_verification_status == o.email_verification_status &&
352
+ api_keys == o.api_keys &&
353
+ contributors == o.contributors &&
354
+ counters == o.counters
355
+ end
356
+
357
+ # @see the `==` method
358
+ # @param [Object] Object to be compared
359
+ def eql?(o)
360
+ self == o
361
+ end
362
+
363
+ # Calculates hash code according to all attributes.
364
+ # @return [Integer] Hash code
365
+ def hash
366
+ [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
367
+ end
368
+
369
+ # Builds the object from hash
370
+ # @param [Hash] attributes Model attributes in the form of hash
371
+ # @return [Object] Returns the model itself
372
+ def self.build_from_hash(attributes)
373
+ new.build_from_hash(attributes)
374
+ end
375
+
376
+ # Builds the object from hash
377
+ # @param [Hash] attributes Model attributes in the form of hash
378
+ # @return [Object] Returns the model itself
379
+ def build_from_hash(attributes)
380
+ return nil unless attributes.is_a?(Hash)
381
+ self.class.openapi_types.each_pair do |key, type|
382
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
383
+ self.send("#{key}=", nil)
384
+ elsif type =~ /\AArray<(.*)>/i
385
+ # check to ensure the input is an array given that the attribute
386
+ # is documented as an array but the input is not
387
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
388
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
389
+ end
390
+ elsif !attributes[self.class.attribute_map[key]].nil?
391
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
392
+ end
393
+ end
394
+
395
+ self
396
+ end
397
+
398
+ # Deserializes the data based on type
399
+ # @param string type Data type
400
+ # @param string value Value to be deserialized
401
+ # @return [Object] Deserialized data
402
+ def _deserialize(type, value)
403
+ case type.to_sym
404
+ when :Time
405
+ Time.parse(value)
406
+ when :Date
407
+ Date.parse(value)
408
+ when :String
409
+ value.to_s
410
+ when :Integer
411
+ value.to_i
412
+ when :Float
413
+ value.to_f
414
+ when :Boolean
415
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
416
+ true
417
+ else
418
+ false
419
+ end
420
+ when :Object
421
+ # generic object (usually a Hash), return directly
422
+ value
423
+ when /\AArray<(?<inner_type>.+)>\z/
424
+ inner_type = Regexp.last_match[:inner_type]
425
+ value.map { |v| _deserialize(inner_type, v) }
426
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
427
+ k_type = Regexp.last_match[:k_type]
428
+ v_type = Regexp.last_match[:v_type]
429
+ {}.tap do |hash|
430
+ value.each do |k, v|
431
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
432
+ end
433
+ end
434
+ else # model
435
+ # models (e.g. Pet) or oneOf
436
+ klass = Notifo.const_get(type)
437
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
438
+ end
439
+ end
440
+
441
+ # Returns the string representation of the object
442
+ # @return [String] String presentation of the object
443
+ def to_s
444
+ to_hash.to_s
445
+ end
446
+
447
+ # to_body is an alias to to_hash (backward compatibility)
448
+ # @return [Hash] Returns the object in the form of hash
449
+ def to_body
450
+ to_hash
451
+ end
452
+
453
+ # Returns the object in the form of hash
454
+ # @return [Hash] Returns the object in the form of hash
455
+ def to_hash
456
+ hash = {}
457
+ self.class.attribute_map.each_pair do |attr, param|
458
+ value = self.send(attr)
459
+ if value.nil?
460
+ is_nullable = self.class.openapi_nullable.include?(attr)
461
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
462
+ end
463
+
464
+ hash[param] = _to_hash(value)
465
+ end
466
+ hash
467
+ end
468
+
469
+ # Outputs non-array value in the form of hash
470
+ # For object, use to_hash. Otherwise, just return the value
471
+ # @param [Object] value Any valid value
472
+ # @return [Hash] Returns the value in the form of hash
473
+ def _to_hash(value)
474
+ if value.is_a?(Array)
475
+ value.compact.map { |v| _to_hash(v) }
476
+ elsif value.is_a?(Hash)
477
+ {}.tap do |hash|
478
+ value.each { |k, v| hash[k] = _to_hash(v) }
479
+ end
480
+ elsif value.respond_to? :to_hash
481
+ value.to_hash
482
+ else
483
+ value
484
+ end
485
+ end
486
+
487
+ end
488
+
489
+ end