notifo-io-easierlife 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +167 -0
- data/Rakefile +10 -0
- data/docs/AddAllowedTopicDto.md +18 -0
- data/docs/AddContributorDto.md +20 -0
- data/docs/AppContributorDto.md +22 -0
- data/docs/AppDetailsDto.md +48 -0
- data/docs/AppDto.md +28 -0
- data/docs/AppsApi.md +646 -0
- data/docs/ConfigsApi.md +127 -0
- data/docs/ConfirmMode.md +15 -0
- data/docs/CreateEmailTemplateDto.md +18 -0
- data/docs/EmailTemplateDto.md +22 -0
- data/docs/EmailVerificationStatus.md +15 -0
- data/docs/ErrorDto.md +26 -0
- data/docs/EventDto.md +40 -0
- data/docs/EventsApi.md +142 -0
- data/docs/IsoDayOfWeek.md +15 -0
- data/docs/ListResponseDtoOfEventDto.md +20 -0
- data/docs/ListResponseDtoOfLogEntryDto.md +20 -0
- data/docs/ListResponseDtoOfMediaDto.md +20 -0
- data/docs/ListResponseDtoOfSubscriptionDto.md +20 -0
- data/docs/ListResponseDtoOfTemplateDto.md +20 -0
- data/docs/ListResponseDtoOfTopicDto.md +20 -0
- data/docs/ListResponseDtoOfUserDto.md +20 -0
- data/docs/LogEntryDto.md +24 -0
- data/docs/LogsApi.md +78 -0
- data/docs/MediaApi.md +382 -0
- data/docs/MediaDto.md +30 -0
- data/docs/MediaType.md +15 -0
- data/docs/NotificationFormattingDto.md +32 -0
- data/docs/NotificationSend.md +15 -0
- data/docs/NotificationSettingDto.md +20 -0
- data/docs/ProfileDto.md +32 -0
- data/docs/PublishDto.md +36 -0
- data/docs/PublishManyDto.md +18 -0
- data/docs/ResizeMode.md +15 -0
- data/docs/SchedulingDto.md +24 -0
- data/docs/SchedulingType.md +15 -0
- data/docs/SubscriptionDto.md +20 -0
- data/docs/TemplateDto.md +22 -0
- data/docs/TemplatesApi.md +208 -0
- data/docs/TopicDto.md +22 -0
- data/docs/TopicsApi.md +78 -0
- data/docs/UpdateProfileDto.md +28 -0
- data/docs/UpsertAppDto.md +36 -0
- data/docs/UpsertTemplateDto.md +22 -0
- data/docs/UpsertTemplatesDto.md +18 -0
- data/docs/UpsertUserDto.md +32 -0
- data/docs/UpsertUsersDto.md +18 -0
- data/docs/UserApi.md +323 -0
- data/docs/UserDto.md +36 -0
- data/docs/UsersApi.md +610 -0
- data/git_push.sh +58 -0
- data/lib/notifo.rb +89 -0
- data/lib/notifo/api/apps_api.rb +678 -0
- data/lib/notifo/api/configs_api.rb +132 -0
- data/lib/notifo/api/events_api.rb +161 -0
- data/lib/notifo/api/logs_api.rb +92 -0
- data/lib/notifo/api/media_api.rb +419 -0
- data/lib/notifo/api/templates_api.rb +228 -0
- data/lib/notifo/api/topics_api.rb +92 -0
- data/lib/notifo/api/user_api.rb +331 -0
- data/lib/notifo/api/users_api.rb +667 -0
- data/lib/notifo/api_client.rb +389 -0
- data/lib/notifo/api_error.rb +57 -0
- data/lib/notifo/configuration.rb +270 -0
- data/lib/notifo/models/add_allowed_topic_dto.rb +243 -0
- data/lib/notifo/models/add_contributor_dto.rb +277 -0
- data/lib/notifo/models/app_contributor_dto.rb +311 -0
- data/lib/notifo/models/app_details_dto.rb +489 -0
- data/lib/notifo/models/app_dto.rb +362 -0
- data/lib/notifo/models/confirm_mode.rb +38 -0
- data/lib/notifo/models/create_email_template_dto.rb +243 -0
- data/lib/notifo/models/email_template_dto.rb +288 -0
- data/lib/notifo/models/email_verification_status.rb +39 -0
- data/lib/notifo/models/error_dto.rb +265 -0
- data/lib/notifo/models/event_dto.rb +456 -0
- data/lib/notifo/models/iso_day_of_week.rb +43 -0
- data/lib/notifo/models/list_response_dto_of_event_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_log_entry_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_media_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_subscription_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_template_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_topic_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_user_dto.rb +241 -0
- data/lib/notifo/models/log_entry_dto.rb +326 -0
- data/lib/notifo/models/media_dto.rb +390 -0
- data/lib/notifo/models/media_type.rb +39 -0
- data/lib/notifo/models/notification_formatting_dto.rb +305 -0
- data/lib/notifo/models/notification_send.rb +39 -0
- data/lib/notifo/models/notification_setting_dto.rb +234 -0
- data/lib/notifo/models/profile_dto.rb +361 -0
- data/lib/notifo/models/publish_dto.rb +338 -0
- data/lib/notifo/models/publish_many_dto.rb +226 -0
- data/lib/notifo/models/resize_mode.rb +42 -0
- data/lib/notifo/models/scheduling_dto.rb +248 -0
- data/lib/notifo/models/scheduling_type.rb +37 -0
- data/lib/notifo/models/subscription_dto.rb +256 -0
- data/lib/notifo/models/template_dto.rb +274 -0
- data/lib/notifo/models/topic_dto.rb +294 -0
- data/lib/notifo/models/update_profile_dto.rb +277 -0
- data/lib/notifo/models/upsert_app_dto.rb +321 -0
- data/lib/notifo/models/upsert_template_dto.rb +270 -0
- data/lib/notifo/models/upsert_templates_dto.rb +226 -0
- data/lib/notifo/models/upsert_user_dto.rb +299 -0
- data/lib/notifo/models/upsert_users_dto.rb +226 -0
- data/lib/notifo/models/user_dto.rb +381 -0
- data/lib/notifo/version.rb +15 -0
- data/notifo-io-1.0.0.gem +0 -0
- data/notifo.gemspec +38 -0
- data/spec/api/apps_api_spec.rb +151 -0
- data/spec/api/configs_api_spec.rb +55 -0
- data/spec/api/events_api_spec.rb +61 -0
- data/spec/api/logs_api_spec.rb +49 -0
- data/spec/api/media_api_spec.rb +117 -0
- data/spec/api/templates_api_spec.rb +73 -0
- data/spec/api/topics_api_spec.rb +49 -0
- data/spec/api/user_api_spec.rb +92 -0
- data/spec/api/users_api_spec.rb +152 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/add_allowed_topic_dto_spec.rb +34 -0
- data/spec/models/add_contributor_dto_spec.rb +40 -0
- data/spec/models/app_contributor_dto_spec.rb +46 -0
- data/spec/models/app_details_dto_spec.rb +124 -0
- data/spec/models/app_dto_spec.rb +64 -0
- data/spec/models/confirm_mode_spec.rb +28 -0
- data/spec/models/create_email_template_dto_spec.rb +34 -0
- data/spec/models/email_template_dto_spec.rb +46 -0
- data/spec/models/email_verification_status_spec.rb +28 -0
- data/spec/models/error_dto_spec.rb +58 -0
- data/spec/models/event_dto_spec.rb +100 -0
- data/spec/models/iso_day_of_week_spec.rb +28 -0
- data/spec/models/list_response_dto_of_event_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_log_entry_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_media_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_subscription_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_template_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_topic_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_user_dto_spec.rb +40 -0
- data/spec/models/log_entry_dto_spec.rb +52 -0
- data/spec/models/media_dto_spec.rb +70 -0
- data/spec/models/media_type_spec.rb +28 -0
- data/spec/models/notification_formatting_dto_spec.rb +76 -0
- data/spec/models/notification_send_spec.rb +28 -0
- data/spec/models/notification_setting_dto_spec.rb +40 -0
- data/spec/models/profile_dto_spec.rb +76 -0
- data/spec/models/publish_dto_spec.rb +88 -0
- data/spec/models/publish_many_dto_spec.rb +34 -0
- data/spec/models/resize_mode_spec.rb +28 -0
- data/spec/models/scheduling_dto_spec.rb +52 -0
- data/spec/models/scheduling_type_spec.rb +28 -0
- data/spec/models/subscription_dto_spec.rb +40 -0
- data/spec/models/template_dto_spec.rb +46 -0
- data/spec/models/topic_dto_spec.rb +46 -0
- data/spec/models/update_profile_dto_spec.rb +64 -0
- data/spec/models/upsert_app_dto_spec.rb +88 -0
- data/spec/models/upsert_template_dto_spec.rb +46 -0
- data/spec/models/upsert_templates_dto_spec.rb +34 -0
- data/spec/models/upsert_user_dto_spec.rb +76 -0
- data/spec/models/upsert_users_dto_spec.rb +34 -0
- data/spec/models/user_dto_spec.rb +88 -0
- data/spec/spec_helper.rb +111 -0
- metadata +301 -0
@@ -0,0 +1,288 @@
|
|
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 EmailTemplateDto
|
18
|
+
# The subject text.
|
19
|
+
attr_accessor :subject
|
20
|
+
|
21
|
+
# The body html template.
|
22
|
+
attr_accessor :body_html
|
23
|
+
|
24
|
+
# The body text template.
|
25
|
+
attr_accessor :body_text
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'subject' => :'subject',
|
31
|
+
:'body_html' => :'bodyHtml',
|
32
|
+
:'body_text' => :'bodyText'
|
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
|
+
:'subject' => :'String',
|
45
|
+
:'body_html' => :'String',
|
46
|
+
:'body_text' => :'String'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# List of attributes with nullable: true
|
51
|
+
def self.openapi_nullable
|
52
|
+
Set.new([
|
53
|
+
:'body_text'
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::EmailTemplateDto` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::EmailTemplateDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
+
end
|
69
|
+
h[k.to_sym] = v
|
70
|
+
}
|
71
|
+
|
72
|
+
if attributes.key?(:'subject')
|
73
|
+
self.subject = attributes[:'subject']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'body_html')
|
77
|
+
self.body_html = attributes[:'body_html']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'body_text')
|
81
|
+
self.body_text = attributes[:'body_text']
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properties with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
if @subject.nil?
|
90
|
+
invalid_properties.push('invalid value for "subject", subject cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
if @subject.to_s.length < 1
|
94
|
+
invalid_properties.push('invalid value for "subject", the character length must be great than or equal to 1.')
|
95
|
+
end
|
96
|
+
|
97
|
+
if @body_html.nil?
|
98
|
+
invalid_properties.push('invalid value for "body_html", body_html cannot be nil.')
|
99
|
+
end
|
100
|
+
|
101
|
+
if @body_html.to_s.length < 1
|
102
|
+
invalid_properties.push('invalid value for "body_html", the character length must be great than or equal to 1.')
|
103
|
+
end
|
104
|
+
|
105
|
+
invalid_properties
|
106
|
+
end
|
107
|
+
|
108
|
+
# Check to see if the all the properties in the model are valid
|
109
|
+
# @return true if the model is valid
|
110
|
+
def valid?
|
111
|
+
return false if @subject.nil?
|
112
|
+
return false if @subject.to_s.length < 1
|
113
|
+
return false if @body_html.nil?
|
114
|
+
return false if @body_html.to_s.length < 1
|
115
|
+
true
|
116
|
+
end
|
117
|
+
|
118
|
+
# Custom attribute writer method with validation
|
119
|
+
# @param [Object] subject Value to be assigned
|
120
|
+
def subject=(subject)
|
121
|
+
if subject.nil?
|
122
|
+
fail ArgumentError, 'subject cannot be nil'
|
123
|
+
end
|
124
|
+
|
125
|
+
if subject.to_s.length < 1
|
126
|
+
fail ArgumentError, 'invalid value for "subject", the character length must be great than or equal to 1.'
|
127
|
+
end
|
128
|
+
|
129
|
+
@subject = subject
|
130
|
+
end
|
131
|
+
|
132
|
+
# Custom attribute writer method with validation
|
133
|
+
# @param [Object] body_html Value to be assigned
|
134
|
+
def body_html=(body_html)
|
135
|
+
if body_html.nil?
|
136
|
+
fail ArgumentError, 'body_html cannot be nil'
|
137
|
+
end
|
138
|
+
|
139
|
+
if body_html.to_s.length < 1
|
140
|
+
fail ArgumentError, 'invalid value for "body_html", the character length must be great than or equal to 1.'
|
141
|
+
end
|
142
|
+
|
143
|
+
@body_html = body_html
|
144
|
+
end
|
145
|
+
|
146
|
+
# Checks equality by comparing each attribute.
|
147
|
+
# @param [Object] Object to be compared
|
148
|
+
def ==(o)
|
149
|
+
return true if self.equal?(o)
|
150
|
+
self.class == o.class &&
|
151
|
+
subject == o.subject &&
|
152
|
+
body_html == o.body_html &&
|
153
|
+
body_text == o.body_text
|
154
|
+
end
|
155
|
+
|
156
|
+
# @see the `==` method
|
157
|
+
# @param [Object] Object to be compared
|
158
|
+
def eql?(o)
|
159
|
+
self == o
|
160
|
+
end
|
161
|
+
|
162
|
+
# Calculates hash code according to all attributes.
|
163
|
+
# @return [Integer] Hash code
|
164
|
+
def hash
|
165
|
+
[subject, body_html, body_text].hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Builds the object from hash
|
169
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
170
|
+
# @return [Object] Returns the model itself
|
171
|
+
def self.build_from_hash(attributes)
|
172
|
+
new.build_from_hash(attributes)
|
173
|
+
end
|
174
|
+
|
175
|
+
# Builds the object from hash
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
177
|
+
# @return [Object] Returns the model itself
|
178
|
+
def build_from_hash(attributes)
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
180
|
+
self.class.openapi_types.each_pair do |key, type|
|
181
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
182
|
+
self.send("#{key}=", nil)
|
183
|
+
elsif type =~ /\AArray<(.*)>/i
|
184
|
+
# check to ensure the input is an array given that the attribute
|
185
|
+
# is documented as an array but the input is not
|
186
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
187
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
188
|
+
end
|
189
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
190
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
self
|
195
|
+
end
|
196
|
+
|
197
|
+
# Deserializes the data based on type
|
198
|
+
# @param string type Data type
|
199
|
+
# @param string value Value to be deserialized
|
200
|
+
# @return [Object] Deserialized data
|
201
|
+
def _deserialize(type, value)
|
202
|
+
case type.to_sym
|
203
|
+
when :Time
|
204
|
+
Time.parse(value)
|
205
|
+
when :Date
|
206
|
+
Date.parse(value)
|
207
|
+
when :String
|
208
|
+
value.to_s
|
209
|
+
when :Integer
|
210
|
+
value.to_i
|
211
|
+
when :Float
|
212
|
+
value.to_f
|
213
|
+
when :Boolean
|
214
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
215
|
+
true
|
216
|
+
else
|
217
|
+
false
|
218
|
+
end
|
219
|
+
when :Object
|
220
|
+
# generic object (usually a Hash), return directly
|
221
|
+
value
|
222
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
223
|
+
inner_type = Regexp.last_match[:inner_type]
|
224
|
+
value.map { |v| _deserialize(inner_type, v) }
|
225
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
226
|
+
k_type = Regexp.last_match[:k_type]
|
227
|
+
v_type = Regexp.last_match[:v_type]
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each do |k, v|
|
230
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
231
|
+
end
|
232
|
+
end
|
233
|
+
else # model
|
234
|
+
# models (e.g. Pet) or oneOf
|
235
|
+
klass = Notifo.const_get(type)
|
236
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
# Returns the string representation of the object
|
241
|
+
# @return [String] String presentation of the object
|
242
|
+
def to_s
|
243
|
+
to_hash.to_s
|
244
|
+
end
|
245
|
+
|
246
|
+
# to_body is an alias to to_hash (backward compatibility)
|
247
|
+
# @return [Hash] Returns the object in the form of hash
|
248
|
+
def to_body
|
249
|
+
to_hash
|
250
|
+
end
|
251
|
+
|
252
|
+
# Returns the object in the form of hash
|
253
|
+
# @return [Hash] Returns the object in the form of hash
|
254
|
+
def to_hash
|
255
|
+
hash = {}
|
256
|
+
self.class.attribute_map.each_pair do |attr, param|
|
257
|
+
value = self.send(attr)
|
258
|
+
if value.nil?
|
259
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
260
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
261
|
+
end
|
262
|
+
|
263
|
+
hash[param] = _to_hash(value)
|
264
|
+
end
|
265
|
+
hash
|
266
|
+
end
|
267
|
+
|
268
|
+
# Outputs non-array value in the form of hash
|
269
|
+
# For object, use to_hash. Otherwise, just return the value
|
270
|
+
# @param [Object] value Any valid value
|
271
|
+
# @return [Hash] Returns the value in the form of hash
|
272
|
+
def _to_hash(value)
|
273
|
+
if value.is_a?(Array)
|
274
|
+
value.compact.map { |v| _to_hash(v) }
|
275
|
+
elsif value.is_a?(Hash)
|
276
|
+
{}.tap do |hash|
|
277
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
278
|
+
end
|
279
|
+
elsif value.respond_to? :to_hash
|
280
|
+
value.to_hash
|
281
|
+
else
|
282
|
+
value
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
end
|
287
|
+
|
288
|
+
end
|
@@ -0,0 +1,39 @@
|
|
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 EmailVerificationStatus
|
18
|
+
NOT_STARTED = "NotStarted".freeze
|
19
|
+
PENDING = "Pending".freeze
|
20
|
+
VERIFIED = "Verified".freeze
|
21
|
+
FAILED = "Failed".freeze
|
22
|
+
|
23
|
+
# Builds the enum from string
|
24
|
+
# @param [String] The enum value in the form of the string
|
25
|
+
# @return [String] The enum value
|
26
|
+
def self.build_from_hash(value)
|
27
|
+
new.build_from_hash(value)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Builds the enum from string
|
31
|
+
# @param [String] The enum value in the form of the string
|
32
|
+
# @return [String] The enum value
|
33
|
+
def build_from_hash(value)
|
34
|
+
constantValues = EmailVerificationStatus.constants.select { |c| EmailVerificationStatus::const_get(c) == value }
|
35
|
+
raise "Invalid ENUM value #{value} for class #EmailVerificationStatus" if constantValues.empty?
|
36
|
+
value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,265 @@
|
|
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 ErrorDto
|
18
|
+
# The error message.
|
19
|
+
attr_accessor :message
|
20
|
+
|
21
|
+
# The optional trace id.
|
22
|
+
attr_accessor :trace_id
|
23
|
+
|
24
|
+
# The error type, usually a link.
|
25
|
+
attr_accessor :type
|
26
|
+
|
27
|
+
# Detailed error messages.
|
28
|
+
attr_accessor :details
|
29
|
+
|
30
|
+
# Status code of the http response.
|
31
|
+
attr_accessor :status_code
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
def self.attribute_map
|
35
|
+
{
|
36
|
+
:'message' => :'message',
|
37
|
+
:'trace_id' => :'traceId',
|
38
|
+
:'type' => :'type',
|
39
|
+
:'details' => :'details',
|
40
|
+
:'status_code' => :'statusCode'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Returns all the JSON keys this model knows about
|
45
|
+
def self.acceptable_attributes
|
46
|
+
attribute_map.values
|
47
|
+
end
|
48
|
+
|
49
|
+
# Attribute type mapping.
|
50
|
+
def self.openapi_types
|
51
|
+
{
|
52
|
+
:'message' => :'String',
|
53
|
+
:'trace_id' => :'String',
|
54
|
+
:'type' => :'String',
|
55
|
+
:'details' => :'Array<String>',
|
56
|
+
:'status_code' => :'Integer'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# List of attributes with nullable: true
|
61
|
+
def self.openapi_nullable
|
62
|
+
Set.new([
|
63
|
+
:'message',
|
64
|
+
:'trace_id',
|
65
|
+
:'type',
|
66
|
+
:'details',
|
67
|
+
])
|
68
|
+
end
|
69
|
+
|
70
|
+
# Initializes the object
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
72
|
+
def initialize(attributes = {})
|
73
|
+
if (!attributes.is_a?(Hash))
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::ErrorDto` initialize method"
|
75
|
+
end
|
76
|
+
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
78
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
79
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
80
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::ErrorDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
81
|
+
end
|
82
|
+
h[k.to_sym] = v
|
83
|
+
}
|
84
|
+
|
85
|
+
if attributes.key?(:'message')
|
86
|
+
self.message = attributes[:'message']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'trace_id')
|
90
|
+
self.trace_id = attributes[:'trace_id']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'type')
|
94
|
+
self.type = attributes[:'type']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'details')
|
98
|
+
if (value = attributes[:'details']).is_a?(Array)
|
99
|
+
self.details = value
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'status_code')
|
104
|
+
self.status_code = attributes[:'status_code']
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
109
|
+
# @return Array for valid properties with the reasons
|
110
|
+
def list_invalid_properties
|
111
|
+
invalid_properties = Array.new
|
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
|
+
true
|
119
|
+
end
|
120
|
+
|
121
|
+
# Checks equality by comparing each attribute.
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def ==(o)
|
124
|
+
return true if self.equal?(o)
|
125
|
+
self.class == o.class &&
|
126
|
+
message == o.message &&
|
127
|
+
trace_id == o.trace_id &&
|
128
|
+
type == o.type &&
|
129
|
+
details == o.details &&
|
130
|
+
status_code == o.status_code
|
131
|
+
end
|
132
|
+
|
133
|
+
# @see the `==` method
|
134
|
+
# @param [Object] Object to be compared
|
135
|
+
def eql?(o)
|
136
|
+
self == o
|
137
|
+
end
|
138
|
+
|
139
|
+
# Calculates hash code according to all attributes.
|
140
|
+
# @return [Integer] Hash code
|
141
|
+
def hash
|
142
|
+
[message, trace_id, type, details, status_code].hash
|
143
|
+
end
|
144
|
+
|
145
|
+
# Builds the object from hash
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
+
# @return [Object] Returns the model itself
|
148
|
+
def self.build_from_hash(attributes)
|
149
|
+
new.build_from_hash(attributes)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Builds the object from hash
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
154
|
+
# @return [Object] Returns the model itself
|
155
|
+
def build_from_hash(attributes)
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
157
|
+
self.class.openapi_types.each_pair do |key, type|
|
158
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
159
|
+
self.send("#{key}=", nil)
|
160
|
+
elsif type =~ /\AArray<(.*)>/i
|
161
|
+
# check to ensure the input is an array given that the attribute
|
162
|
+
# is documented as an array but the input is not
|
163
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
164
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
165
|
+
end
|
166
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
167
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
self
|
172
|
+
end
|
173
|
+
|
174
|
+
# Deserializes the data based on type
|
175
|
+
# @param string type Data type
|
176
|
+
# @param string value Value to be deserialized
|
177
|
+
# @return [Object] Deserialized data
|
178
|
+
def _deserialize(type, value)
|
179
|
+
case type.to_sym
|
180
|
+
when :Time
|
181
|
+
Time.parse(value)
|
182
|
+
when :Date
|
183
|
+
Date.parse(value)
|
184
|
+
when :String
|
185
|
+
value.to_s
|
186
|
+
when :Integer
|
187
|
+
value.to_i
|
188
|
+
when :Float
|
189
|
+
value.to_f
|
190
|
+
when :Boolean
|
191
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
192
|
+
true
|
193
|
+
else
|
194
|
+
false
|
195
|
+
end
|
196
|
+
when :Object
|
197
|
+
# generic object (usually a Hash), return directly
|
198
|
+
value
|
199
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
200
|
+
inner_type = Regexp.last_match[:inner_type]
|
201
|
+
value.map { |v| _deserialize(inner_type, v) }
|
202
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
203
|
+
k_type = Regexp.last_match[:k_type]
|
204
|
+
v_type = Regexp.last_match[:v_type]
|
205
|
+
{}.tap do |hash|
|
206
|
+
value.each do |k, v|
|
207
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
else # model
|
211
|
+
# models (e.g. Pet) or oneOf
|
212
|
+
klass = Notifo.const_get(type)
|
213
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
# Returns the string representation of the object
|
218
|
+
# @return [String] String presentation of the object
|
219
|
+
def to_s
|
220
|
+
to_hash.to_s
|
221
|
+
end
|
222
|
+
|
223
|
+
# to_body is an alias to to_hash (backward compatibility)
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
225
|
+
def to_body
|
226
|
+
to_hash
|
227
|
+
end
|
228
|
+
|
229
|
+
# Returns the object in the form of hash
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_hash
|
232
|
+
hash = {}
|
233
|
+
self.class.attribute_map.each_pair do |attr, param|
|
234
|
+
value = self.send(attr)
|
235
|
+
if value.nil?
|
236
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
237
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
238
|
+
end
|
239
|
+
|
240
|
+
hash[param] = _to_hash(value)
|
241
|
+
end
|
242
|
+
hash
|
243
|
+
end
|
244
|
+
|
245
|
+
# Outputs non-array value in the form of hash
|
246
|
+
# For object, use to_hash. Otherwise, just return the value
|
247
|
+
# @param [Object] value Any valid value
|
248
|
+
# @return [Hash] Returns the value in the form of hash
|
249
|
+
def _to_hash(value)
|
250
|
+
if value.is_a?(Array)
|
251
|
+
value.compact.map { |v| _to_hash(v) }
|
252
|
+
elsif value.is_a?(Hash)
|
253
|
+
{}.tap do |hash|
|
254
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
255
|
+
end
|
256
|
+
elsif value.respond_to? :to_hash
|
257
|
+
value.to_hash
|
258
|
+
else
|
259
|
+
value
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
end
|
264
|
+
|
265
|
+
end
|