notifo-io-easierlife 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,277 @@
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 UpdateProfileDto
18
+ # The full name of the user.
19
+ attr_accessor :full_name
20
+
21
+ # The email of the user.
22
+ attr_accessor :email_address
23
+
24
+ # The phone number.
25
+ attr_accessor :phone_number
26
+
27
+ # The preferred language of the user.
28
+ attr_accessor :preferred_language
29
+
30
+ # The timezone of the user.
31
+ attr_accessor :preferred_timezone
32
+
33
+ # Notification settings per channel.
34
+ attr_accessor :settings
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'full_name' => :'fullName',
40
+ :'email_address' => :'emailAddress',
41
+ :'phone_number' => :'phoneNumber',
42
+ :'preferred_language' => :'preferredLanguage',
43
+ :'preferred_timezone' => :'preferredTimezone',
44
+ :'settings' => :'settings'
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
+ :'full_name' => :'String',
57
+ :'email_address' => :'String',
58
+ :'phone_number' => :'String',
59
+ :'preferred_language' => :'String',
60
+ :'preferred_timezone' => :'String',
61
+ :'settings' => :'Hash<String, NotificationSettingDto>'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ :'full_name',
69
+ :'email_address',
70
+ :'phone_number',
71
+ :'preferred_language',
72
+ :'preferred_timezone',
73
+ :'settings'
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::UpdateProfileDto` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::UpdateProfileDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'full_name')
93
+ self.full_name = attributes[:'full_name']
94
+ end
95
+
96
+ if attributes.key?(:'email_address')
97
+ self.email_address = attributes[:'email_address']
98
+ end
99
+
100
+ if attributes.key?(:'phone_number')
101
+ self.phone_number = attributes[:'phone_number']
102
+ end
103
+
104
+ if attributes.key?(:'preferred_language')
105
+ self.preferred_language = attributes[:'preferred_language']
106
+ end
107
+
108
+ if attributes.key?(:'preferred_timezone')
109
+ self.preferred_timezone = attributes[:'preferred_timezone']
110
+ end
111
+
112
+ if attributes.key?(:'settings')
113
+ if (value = attributes[:'settings']).is_a?(Hash)
114
+ self.settings = value
115
+ end
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ true
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ full_name == o.full_name &&
138
+ email_address == o.email_address &&
139
+ phone_number == o.phone_number &&
140
+ preferred_language == o.preferred_language &&
141
+ preferred_timezone == o.preferred_timezone &&
142
+ settings == o.settings
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [full_name, email_address, phone_number, preferred_language, preferred_timezone, settings].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ new.build_from_hash(attributes)
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ self.class.openapi_types.each_pair do |key, type|
170
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
171
+ self.send("#{key}=", nil)
172
+ elsif type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
176
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
177
+ end
178
+ elsif !attributes[self.class.attribute_map[key]].nil?
179
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
180
+ end
181
+ end
182
+
183
+ self
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def _deserialize(type, value)
191
+ case type.to_sym
192
+ when :Time
193
+ Time.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ # models (e.g. Pet) or oneOf
224
+ klass = Notifo.const_get(type)
225
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ # Outputs non-array value in the form of hash
258
+ # For object, use to_hash. Otherwise, just return the value
259
+ # @param [Object] value Any valid value
260
+ # @return [Hash] Returns the value in the form of hash
261
+ def _to_hash(value)
262
+ if value.is_a?(Array)
263
+ value.compact.map { |v| _to_hash(v) }
264
+ elsif value.is_a?(Hash)
265
+ {}.tap do |hash|
266
+ value.each { |k, v| hash[k] = _to_hash(v) }
267
+ end
268
+ elsif value.respond_to? :to_hash
269
+ value.to_hash
270
+ else
271
+ value
272
+ end
273
+ end
274
+
275
+ end
276
+
277
+ end
@@ -0,0 +1,321 @@
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 UpsertAppDto
18
+ # The app name.
19
+ attr_accessor :name
20
+
21
+ # The supported languages.
22
+ attr_accessor :languages
23
+
24
+ # The sender email address.
25
+ attr_accessor :email_address
26
+
27
+ # The sender email name.
28
+ attr_accessor :email_name
29
+
30
+ # The firebase project ID.
31
+ attr_accessor :firebase_project
32
+
33
+ # The firebase credentials.
34
+ attr_accessor :firebase_credential
35
+
36
+ # The webhook URL.
37
+ attr_accessor :webhook_url
38
+
39
+ # The confirm URL.
40
+ attr_accessor :confirm_url
41
+
42
+ # True, when emails are allowed.
43
+ attr_accessor :allow_email
44
+
45
+ # True, when SMS are allowed.
46
+ attr_accessor :allow_sms
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'name' => :'name',
52
+ :'languages' => :'languages',
53
+ :'email_address' => :'emailAddress',
54
+ :'email_name' => :'emailName',
55
+ :'firebase_project' => :'firebaseProject',
56
+ :'firebase_credential' => :'firebaseCredential',
57
+ :'webhook_url' => :'webhookUrl',
58
+ :'confirm_url' => :'confirmUrl',
59
+ :'allow_email' => :'allowEmail',
60
+ :'allow_sms' => :'allowSms'
61
+ }
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'name' => :'String',
73
+ :'languages' => :'Array<String>',
74
+ :'email_address' => :'String',
75
+ :'email_name' => :'String',
76
+ :'firebase_project' => :'String',
77
+ :'firebase_credential' => :'String',
78
+ :'webhook_url' => :'String',
79
+ :'confirm_url' => :'String',
80
+ :'allow_email' => :'Boolean',
81
+ :'allow_sms' => :'Boolean'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ :'name',
89
+ :'languages',
90
+ :'email_address',
91
+ :'email_name',
92
+ :'firebase_project',
93
+ :'firebase_credential',
94
+ :'webhook_url',
95
+ :'confirm_url',
96
+ :'allow_email',
97
+ :'allow_sms'
98
+ ])
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::UpsertAppDto` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!self.class.attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::UpsertAppDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'name')
117
+ self.name = attributes[:'name']
118
+ end
119
+
120
+ if attributes.key?(:'languages')
121
+ if (value = attributes[:'languages']).is_a?(Array)
122
+ self.languages = value
123
+ end
124
+ end
125
+
126
+ if attributes.key?(:'email_address')
127
+ self.email_address = attributes[:'email_address']
128
+ end
129
+
130
+ if attributes.key?(:'email_name')
131
+ self.email_name = attributes[:'email_name']
132
+ end
133
+
134
+ if attributes.key?(:'firebase_project')
135
+ self.firebase_project = attributes[:'firebase_project']
136
+ end
137
+
138
+ if attributes.key?(:'firebase_credential')
139
+ self.firebase_credential = attributes[:'firebase_credential']
140
+ end
141
+
142
+ if attributes.key?(:'webhook_url')
143
+ self.webhook_url = attributes[:'webhook_url']
144
+ end
145
+
146
+ if attributes.key?(:'confirm_url')
147
+ self.confirm_url = attributes[:'confirm_url']
148
+ end
149
+
150
+ if attributes.key?(:'allow_email')
151
+ self.allow_email = attributes[:'allow_email']
152
+ end
153
+
154
+ if attributes.key?(:'allow_sms')
155
+ self.allow_sms = attributes[:'allow_sms']
156
+ end
157
+ end
158
+
159
+ # Show invalid properties with the reasons. Usually used together with valid?
160
+ # @return Array for valid properties with the reasons
161
+ def list_invalid_properties
162
+ invalid_properties = Array.new
163
+ invalid_properties
164
+ end
165
+
166
+ # Check to see if the all the properties in the model are valid
167
+ # @return true if the model is valid
168
+ def valid?
169
+ true
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ name == o.name &&
178
+ languages == o.languages &&
179
+ email_address == o.email_address &&
180
+ email_name == o.email_name &&
181
+ firebase_project == o.firebase_project &&
182
+ firebase_credential == o.firebase_credential &&
183
+ webhook_url == o.webhook_url &&
184
+ confirm_url == o.confirm_url &&
185
+ allow_email == o.allow_email &&
186
+ allow_sms == o.allow_sms
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [name, languages, email_address, email_name, firebase_project, firebase_credential, webhook_url, confirm_url, allow_email, allow_sms].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ new.build_from_hash(attributes)
206
+ end
207
+
208
+ # Builds the object from hash
209
+ # @param [Hash] attributes Model attributes in the form of hash
210
+ # @return [Object] Returns the model itself
211
+ def build_from_hash(attributes)
212
+ return nil unless attributes.is_a?(Hash)
213
+ self.class.openapi_types.each_pair do |key, type|
214
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
215
+ self.send("#{key}=", nil)
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
220
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
221
+ end
222
+ elsif !attributes[self.class.attribute_map[key]].nil?
223
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
224
+ end
225
+ end
226
+
227
+ self
228
+ end
229
+
230
+ # Deserializes the data based on type
231
+ # @param string type Data type
232
+ # @param string value Value to be deserialized
233
+ # @return [Object] Deserialized data
234
+ def _deserialize(type, value)
235
+ case type.to_sym
236
+ when :Time
237
+ Time.parse(value)
238
+ when :Date
239
+ Date.parse(value)
240
+ when :String
241
+ value.to_s
242
+ when :Integer
243
+ value.to_i
244
+ when :Float
245
+ value.to_f
246
+ when :Boolean
247
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
248
+ true
249
+ else
250
+ false
251
+ end
252
+ when :Object
253
+ # generic object (usually a Hash), return directly
254
+ value
255
+ when /\AArray<(?<inner_type>.+)>\z/
256
+ inner_type = Regexp.last_match[:inner_type]
257
+ value.map { |v| _deserialize(inner_type, v) }
258
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
259
+ k_type = Regexp.last_match[:k_type]
260
+ v_type = Regexp.last_match[:v_type]
261
+ {}.tap do |hash|
262
+ value.each do |k, v|
263
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
264
+ end
265
+ end
266
+ else # model
267
+ # models (e.g. Pet) or oneOf
268
+ klass = Notifo.const_get(type)
269
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
270
+ end
271
+ end
272
+
273
+ # Returns the string representation of the object
274
+ # @return [String] String presentation of the object
275
+ def to_s
276
+ to_hash.to_s
277
+ end
278
+
279
+ # to_body is an alias to to_hash (backward compatibility)
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_body
282
+ to_hash
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = self.send(attr)
291
+ if value.nil?
292
+ is_nullable = self.class.openapi_nullable.include?(attr)
293
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
294
+ end
295
+
296
+ hash[param] = _to_hash(value)
297
+ end
298
+ hash
299
+ end
300
+
301
+ # Outputs non-array value in the form of hash
302
+ # For object, use to_hash. Otherwise, just return the value
303
+ # @param [Object] value Any valid value
304
+ # @return [Hash] Returns the value in the form of hash
305
+ def _to_hash(value)
306
+ if value.is_a?(Array)
307
+ value.compact.map { |v| _to_hash(v) }
308
+ elsif value.is_a?(Hash)
309
+ {}.tap do |hash|
310
+ value.each { |k, v| hash[k] = _to_hash(v) }
311
+ end
312
+ elsif value.respond_to? :to_hash
313
+ value.to_hash
314
+ else
315
+ value
316
+ end
317
+ end
318
+
319
+ end
320
+
321
+ end