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,219 @@
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 AddAllowedTopicRequest
18
+ # The topic to add.
19
+ attr_accessor :prefix
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'prefix' => :'prefix'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'prefix' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::AddAllowedTopicRequest` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::AddAllowedTopicRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'prefix')
62
+ self.prefix = attributes[:'prefix']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ prefix == o.prefix
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [prefix].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = Notifo.const_get(type)
167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -0,0 +1,229 @@
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 AddContributorDto
18
+ # The email of the new contributor.
19
+ attr_accessor :email
20
+
21
+ # The role.
22
+ attr_accessor :role
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'email' => :'email',
28
+ :'role' => :'role'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'email' => :'String',
41
+ :'role' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::AddContributorDto` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::AddContributorDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'email')
67
+ self.email = attributes[:'email']
68
+ end
69
+
70
+ if attributes.key?(:'role')
71
+ self.role = attributes[:'role']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ email == o.email &&
94
+ role == o.role
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [email, role].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ new.build_from_hash(attributes)
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.openapi_types.each_pair do |key, type|
122
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
+ self.send("#{key}=", nil)
124
+ elsif type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = Notifo.const_get(type)
177
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end
@@ -0,0 +1,239 @@
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 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
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ user_id == o.user_id &&
103
+ user_name == o.user_name &&
104
+ role == o.role
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [user_id, user_name, role].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = Notifo.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end