mailslurp_client 7.0.8 → 7.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +12 -3
  3. metadata +11 -372
  4. data/Gemfile +0 -9
  5. data/LICENSE +0 -22
  6. data/Makefile +0 -3
  7. data/README.md +0 -239
  8. data/Rakefile +0 -10
  9. data/docs/AliasControllerApi.md +0 -337
  10. data/docs/AttachmentControllerApi.md +0 -126
  11. data/docs/AttachmentMetaData.md +0 -23
  12. data/docs/BasicAuthOptions.md +0 -19
  13. data/docs/BulkActionsControllerApi.md +0 -165
  14. data/docs/BulkSendEmailOptions.md +0 -19
  15. data/docs/CommonActionsControllerApi.md +0 -218
  16. data/docs/ContactControllerApi.md +0 -274
  17. data/docs/ContactDto.md +0 -31
  18. data/docs/ContactProjection.md +0 -27
  19. data/docs/CreateAnonymousAliasOptions.md +0 -17
  20. data/docs/CreateContactOptions.md +0 -31
  21. data/docs/CreateDomainOptions.md +0 -17
  22. data/docs/CreateGroupOptions.md +0 -19
  23. data/docs/CreateOwnedAliasOptions.md +0 -23
  24. data/docs/CreateTemplateOptions.md +0 -19
  25. data/docs/CreateWebhookOptions.md +0 -21
  26. data/docs/DomainControllerApi.md +0 -223
  27. data/docs/DomainDto.md +0 -29
  28. data/docs/DomainPreview.md +0 -21
  29. data/docs/Email.md +0 -49
  30. data/docs/EmailAnalysis.md +0 -25
  31. data/docs/EmailControllerApi.md +0 -740
  32. data/docs/EmailPreview.md +0 -31
  33. data/docs/EmailProjection.md +0 -33
  34. data/docs/FormControllerApi.md +0 -79
  35. data/docs/ForwardEmailOptions.md +0 -23
  36. data/docs/GroupContactsDto.md +0 -19
  37. data/docs/GroupControllerApi.md +0 -437
  38. data/docs/GroupDto.md +0 -23
  39. data/docs/GroupProjection.md +0 -23
  40. data/docs/HTMLValidationResult.md +0 -21
  41. data/docs/Inbox.md +0 -33
  42. data/docs/InboxControllerApi.md +0 -705
  43. data/docs/InboxProjection.md +0 -29
  44. data/docs/JsonNode.md +0 -59
  45. data/docs/MatchOption.md +0 -21
  46. data/docs/MatchOptions.md +0 -17
  47. data/docs/ModelAlias.md +0 -31
  48. data/docs/PageAlias.md +0 -37
  49. data/docs/PageContactProjection.md +0 -37
  50. data/docs/PageEmailPreview.md +0 -37
  51. data/docs/PageEmailProjection.md +0 -37
  52. data/docs/PageGroupProjection.md +0 -37
  53. data/docs/PageInboxProjection.md +0 -37
  54. data/docs/PageTemplateProjection.md +0 -37
  55. data/docs/PageWebhookProjection.md +0 -37
  56. data/docs/Pageable.md +0 -27
  57. data/docs/RawEmailJson.md +0 -17
  58. data/docs/SendEmailOptions.md +0 -45
  59. data/docs/SetInboxFavouritedOptions.md +0 -17
  60. data/docs/SimpleSendEmailOptions.md +0 -23
  61. data/docs/Sort.md +0 -21
  62. data/docs/TemplateControllerApi.md +0 -274
  63. data/docs/TemplateDto.md +0 -25
  64. data/docs/TemplateProjection.md +0 -25
  65. data/docs/TemplateVariable.md +0 -19
  66. data/docs/UnreadCount.md +0 -17
  67. data/docs/UpdateGroupContacts.md +0 -17
  68. data/docs/UpdateInboxOptions.md +0 -25
  69. data/docs/UploadAttachmentOptions.md +0 -21
  70. data/docs/ValidationDto.md +0 -19
  71. data/docs/ValidationMessage.md +0 -19
  72. data/docs/WaitForConditions.md +0 -29
  73. data/docs/WaitForControllerApi.md +0 -317
  74. data/docs/WebhookControllerApi.md +0 -339
  75. data/docs/WebhookDto.md +0 -33
  76. data/docs/WebhookProjection.md +0 -27
  77. data/docs/WebhookTestRequest.md +0 -23
  78. data/docs/WebhookTestResponse.md +0 -19
  79. data/docs/WebhookTestResult.md +0 -21
  80. data/git_push.sh +0 -58
  81. data/lib/mailslurp_client/api/alias_controller_api.rb +0 -405
  82. data/lib/mailslurp_client/api/attachment_controller_api.rb +0 -160
  83. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +0 -203
  84. data/lib/mailslurp_client/api/common_actions_controller_api.rb +0 -257
  85. data/lib/mailslurp_client/api/contact_controller_api.rb +0 -323
  86. data/lib/mailslurp_client/api/domain_controller_api.rb +0 -264
  87. data/lib/mailslurp_client/api/email_controller_api.rb +0 -852
  88. data/lib/mailslurp_client/api/form_controller_api.rb +0 -104
  89. data/lib/mailslurp_client/api/group_controller_api.rb +0 -519
  90. data/lib/mailslurp_client/api/inbox_controller_api.rb +0 -822
  91. data/lib/mailslurp_client/api/template_controller_api.rb +0 -323
  92. data/lib/mailslurp_client/api/wait_for_controller_api.rb +0 -359
  93. data/lib/mailslurp_client/api/webhook_controller_api.rb +0 -405
  94. data/lib/mailslurp_client/api_client.rb +0 -386
  95. data/lib/mailslurp_client/api_error.rb +0 -57
  96. data/lib/mailslurp_client/configuration.rb +0 -248
  97. data/lib/mailslurp_client/models/attachment_meta_data.rb +0 -238
  98. data/lib/mailslurp_client/models/basic_auth_options.rb +0 -226
  99. data/lib/mailslurp_client/models/bulk_send_email_options.rb +0 -219
  100. data/lib/mailslurp_client/models/contact_dto.rb +0 -288
  101. data/lib/mailslurp_client/models/contact_projection.rb +0 -261
  102. data/lib/mailslurp_client/models/create_anonymous_alias_options.rb +0 -208
  103. data/lib/mailslurp_client/models/create_contact_options.rb +0 -277
  104. data/lib/mailslurp_client/models/create_domain_options.rb +0 -208
  105. data/lib/mailslurp_client/models/create_group_options.rb +0 -220
  106. data/lib/mailslurp_client/models/create_owned_alias_options.rb +0 -238
  107. data/lib/mailslurp_client/models/create_template_options.rb +0 -225
  108. data/lib/mailslurp_client/models/create_webhook_options.rb +0 -227
  109. data/lib/mailslurp_client/models/domain_dto.rb +0 -296
  110. data/lib/mailslurp_client/models/domain_preview.rb +0 -240
  111. data/lib/mailslurp_client/models/email.rb +0 -376
  112. data/lib/mailslurp_client/models/email_analysis.rb +0 -248
  113. data/lib/mailslurp_client/models/email_preview.rb +0 -286
  114. data/lib/mailslurp_client/models/email_projection.rb +0 -307
  115. data/lib/mailslurp_client/models/forward_email_options.rb +0 -244
  116. data/lib/mailslurp_client/models/group_contacts_dto.rb +0 -227
  117. data/lib/mailslurp_client/models/group_dto.rb +0 -248
  118. data/lib/mailslurp_client/models/group_projection.rb +0 -248
  119. data/lib/mailslurp_client/models/html_validation_result.rb +0 -243
  120. data/lib/mailslurp_client/models/inbox.rb +0 -290
  121. data/lib/mailslurp_client/models/inbox_projection.rb +0 -272
  122. data/lib/mailslurp_client/models/json_node.rb +0 -429
  123. data/lib/mailslurp_client/models/match_option.rb +0 -274
  124. data/lib/mailslurp_client/models/match_options.rb +0 -210
  125. data/lib/mailslurp_client/models/model_alias.rb +0 -284
  126. data/lib/mailslurp_client/models/page_alias.rb +0 -298
  127. data/lib/mailslurp_client/models/page_contact_projection.rb +0 -298
  128. data/lib/mailslurp_client/models/page_email_preview.rb +0 -298
  129. data/lib/mailslurp_client/models/page_email_projection.rb +0 -298
  130. data/lib/mailslurp_client/models/page_group_projection.rb +0 -298
  131. data/lib/mailslurp_client/models/page_inbox_projection.rb +0 -298
  132. data/lib/mailslurp_client/models/page_template_projection.rb +0 -298
  133. data/lib/mailslurp_client/models/page_webhook_projection.rb +0 -298
  134. data/lib/mailslurp_client/models/pageable.rb +0 -251
  135. data/lib/mailslurp_client/models/raw_email_json.rb +0 -211
  136. data/lib/mailslurp_client/models/send_email_options.rb +0 -392
  137. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +0 -208
  138. data/lib/mailslurp_client/models/simple_send_email_options.rb +0 -237
  139. data/lib/mailslurp_client/models/sort.rb +0 -224
  140. data/lib/mailslurp_client/models/template_dto.rb +0 -269
  141. data/lib/mailslurp_client/models/template_projection.rb +0 -269
  142. data/lib/mailslurp_client/models/template_variable.rb +0 -259
  143. data/lib/mailslurp_client/models/unread_count.rb +0 -211
  144. data/lib/mailslurp_client/models/update_group_contacts.rb +0 -213
  145. data/lib/mailslurp_client/models/update_inbox_options.rb +0 -250
  146. data/lib/mailslurp_client/models/upload_attachment_options.rb +0 -228
  147. data/lib/mailslurp_client/models/validation_dto.rb +0 -217
  148. data/lib/mailslurp_client/models/validation_message.rb +0 -220
  149. data/lib/mailslurp_client/models/wait_for_conditions.rb +0 -316
  150. data/lib/mailslurp_client/models/webhook_dto.rb +0 -326
  151. data/lib/mailslurp_client/models/webhook_projection.rb +0 -277
  152. data/lib/mailslurp_client/models/webhook_test_request.rb +0 -284
  153. data/lib/mailslurp_client/models/webhook_test_response.rb +0 -215
  154. data/lib/mailslurp_client/models/webhook_test_result.rb +0 -235
  155. data/lib/mailslurp_client/version.rb +0 -15
  156. data/mailslurp_client.gemspec +0 -39
  157. data/spec/api/alias_controller_api_spec.rb +0 -107
  158. data/spec/api/attachment_controller_api_spec.rb +0 -61
  159. data/spec/api/bulk_actions_controller_api_spec.rb +0 -68
  160. data/spec/api/common_actions_controller_api_spec.rb +0 -129
  161. data/spec/api/contact_controller_api_spec.rb +0 -91
  162. data/spec/api/domain_controller_api_spec.rb +0 -82
  163. data/spec/api/email_controller_api_spec.rb +0 -162
  164. data/spec/api/form_controller_api_spec.rb +0 -54
  165. data/spec/api/group_controller_api_spec.rb +0 -126
  166. data/spec/api/inbox_controller_api_spec.rb +0 -172
  167. data/spec/api/template_controller_api_spec.rb +0 -91
  168. data/spec/api/wait_for_controller_api_spec.rb +0 -107
  169. data/spec/api/webhook_controller_api_spec.rb +0 -107
  170. data/spec/api_client_spec.rb +0 -226
  171. data/spec/configuration_spec.rb +0 -42
  172. data/spec/models/attachment_meta_data_spec.rb +0 -59
  173. data/spec/models/basic_auth_options_spec.rb +0 -47
  174. data/spec/models/bulk_send_email_options_spec.rb +0 -47
  175. data/spec/models/contact_dto_spec.rb +0 -83
  176. data/spec/models/contact_projection_spec.rb +0 -71
  177. data/spec/models/create_anonymous_alias_options_spec.rb +0 -41
  178. data/spec/models/create_contact_options_spec.rb +0 -83
  179. data/spec/models/create_domain_options_spec.rb +0 -41
  180. data/spec/models/create_group_options_spec.rb +0 -47
  181. data/spec/models/create_owned_alias_options_spec.rb +0 -59
  182. data/spec/models/create_template_options_spec.rb +0 -47
  183. data/spec/models/create_webhook_options_spec.rb +0 -53
  184. data/spec/models/domain_dto_spec.rb +0 -77
  185. data/spec/models/domain_preview_spec.rb +0 -53
  186. data/spec/models/email_analysis_spec.rb +0 -65
  187. data/spec/models/email_preview_spec.rb +0 -83
  188. data/spec/models/email_projection_spec.rb +0 -89
  189. data/spec/models/email_spec.rb +0 -137
  190. data/spec/models/forward_email_options_spec.rb +0 -59
  191. data/spec/models/group_contacts_dto_spec.rb +0 -47
  192. data/spec/models/group_dto_spec.rb +0 -59
  193. data/spec/models/group_projection_spec.rb +0 -59
  194. data/spec/models/html_validation_result_spec.rb +0 -53
  195. data/spec/models/inbox_projection_spec.rb +0 -77
  196. data/spec/models/inbox_spec.rb +0 -89
  197. data/spec/models/json_node_spec.rb +0 -171
  198. data/spec/models/match_option_spec.rb +0 -61
  199. data/spec/models/match_options_spec.rb +0 -41
  200. data/spec/models/model_alias_spec.rb +0 -83
  201. data/spec/models/page_alias_spec.rb +0 -101
  202. data/spec/models/page_contact_projection_spec.rb +0 -101
  203. data/spec/models/page_email_preview_spec.rb +0 -101
  204. data/spec/models/page_email_projection_spec.rb +0 -101
  205. data/spec/models/page_group_projection_spec.rb +0 -101
  206. data/spec/models/page_inbox_projection_spec.rb +0 -101
  207. data/spec/models/page_template_projection_spec.rb +0 -101
  208. data/spec/models/page_webhook_projection_spec.rb +0 -101
  209. data/spec/models/pageable_spec.rb +0 -71
  210. data/spec/models/raw_email_json_spec.rb +0 -41
  211. data/spec/models/send_email_options_spec.rb +0 -129
  212. data/spec/models/set_inbox_favourited_options_spec.rb +0 -41
  213. data/spec/models/simple_send_email_options_spec.rb +0 -59
  214. data/spec/models/sort_spec.rb +0 -53
  215. data/spec/models/template_dto_spec.rb +0 -65
  216. data/spec/models/template_projection_spec.rb +0 -65
  217. data/spec/models/template_variable_spec.rb +0 -51
  218. data/spec/models/unread_count_spec.rb +0 -41
  219. data/spec/models/update_group_contacts_spec.rb +0 -41
  220. data/spec/models/update_inbox_options_spec.rb +0 -65
  221. data/spec/models/upload_attachment_options_spec.rb +0 -53
  222. data/spec/models/validation_dto_spec.rb +0 -47
  223. data/spec/models/validation_message_spec.rb +0 -47
  224. data/spec/models/wait_for_conditions_spec.rb +0 -85
  225. data/spec/models/webhook_dto_spec.rb +0 -93
  226. data/spec/models/webhook_projection_spec.rb +0 -71
  227. data/spec/models/webhook_test_request_spec.rb +0 -63
  228. data/spec/models/webhook_test_response_spec.rb +0 -47
  229. data/spec/models/webhook_test_result_spec.rb +0 -53
  230. data/spec/spec_helper.rb +0 -111
@@ -1,284 +0,0 @@
1
- =begin
2
- #MailSlurp API
3
-
4
- #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
-
6
- The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module MailSlurpClient
16
- class ModelAlias
17
- attr_accessor :created_at
18
-
19
- attr_accessor :email_address
20
-
21
- attr_accessor :id
22
-
23
- attr_accessor :inbox_id
24
-
25
- attr_accessor :name
26
-
27
- attr_accessor :proxied
28
-
29
- attr_accessor :updated_at
30
-
31
- attr_accessor :user_id
32
-
33
- # Attribute mapping from ruby-style variable name to JSON key.
34
- def self.attribute_map
35
- {
36
- :'created_at' => :'createdAt',
37
- :'email_address' => :'emailAddress',
38
- :'id' => :'id',
39
- :'inbox_id' => :'inboxId',
40
- :'name' => :'name',
41
- :'proxied' => :'proxied',
42
- :'updated_at' => :'updatedAt',
43
- :'user_id' => :'userId'
44
- }
45
- end
46
-
47
- # Attribute type mapping.
48
- def self.openapi_types
49
- {
50
- :'created_at' => :'DateTime',
51
- :'email_address' => :'String',
52
- :'id' => :'String',
53
- :'inbox_id' => :'String',
54
- :'name' => :'String',
55
- :'proxied' => :'Boolean',
56
- :'updated_at' => :'DateTime',
57
- :'user_id' => :'String'
58
- }
59
- end
60
-
61
- # List of attributes with nullable: true
62
- def self.openapi_nullable
63
- Set.new([
64
- ])
65
- end
66
-
67
- # Initializes the object
68
- # @param [Hash] attributes Model attributes in the form of hash
69
- def initialize(attributes = {})
70
- if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ModelAlias` initialize method"
72
- end
73
-
74
- # check to see if the attribute exists and convert string to symbol for hash key
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!self.class.attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ModelAlias`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'created_at')
83
- self.created_at = attributes[:'created_at']
84
- end
85
-
86
- if attributes.key?(:'email_address')
87
- self.email_address = attributes[:'email_address']
88
- end
89
-
90
- if attributes.key?(:'id')
91
- self.id = attributes[:'id']
92
- end
93
-
94
- if attributes.key?(:'inbox_id')
95
- self.inbox_id = attributes[:'inbox_id']
96
- end
97
-
98
- if attributes.key?(:'name')
99
- self.name = attributes[:'name']
100
- end
101
-
102
- if attributes.key?(:'proxied')
103
- self.proxied = attributes[:'proxied']
104
- end
105
-
106
- if attributes.key?(:'updated_at')
107
- self.updated_at = attributes[:'updated_at']
108
- end
109
-
110
- if attributes.key?(:'user_id')
111
- self.user_id = attributes[:'user_id']
112
- end
113
- end
114
-
115
- # Show invalid properties with the reasons. Usually used together with valid?
116
- # @return Array for valid properties with the reasons
117
- def list_invalid_properties
118
- invalid_properties = Array.new
119
- if @created_at.nil?
120
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
121
- end
122
-
123
- if @email_address.nil?
124
- invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
125
- end
126
-
127
- if @updated_at.nil?
128
- invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
129
- end
130
-
131
- invalid_properties
132
- end
133
-
134
- # Check to see if the all the properties in the model are valid
135
- # @return true if the model is valid
136
- def valid?
137
- return false if @created_at.nil?
138
- return false if @email_address.nil?
139
- return false if @updated_at.nil?
140
- true
141
- end
142
-
143
- # Checks equality by comparing each attribute.
144
- # @param [Object] Object to be compared
145
- def ==(o)
146
- return true if self.equal?(o)
147
- self.class == o.class &&
148
- created_at == o.created_at &&
149
- email_address == o.email_address &&
150
- id == o.id &&
151
- inbox_id == o.inbox_id &&
152
- name == o.name &&
153
- proxied == o.proxied &&
154
- updated_at == o.updated_at &&
155
- user_id == o.user_id
156
- end
157
-
158
- # @see the `==` method
159
- # @param [Object] Object to be compared
160
- def eql?(o)
161
- self == o
162
- end
163
-
164
- # Calculates hash code according to all attributes.
165
- # @return [Integer] Hash code
166
- def hash
167
- [created_at, email_address, id, inbox_id, name, proxied, updated_at, user_id].hash
168
- end
169
-
170
- # Builds the object from hash
171
- # @param [Hash] attributes Model attributes in the form of hash
172
- # @return [Object] Returns the model itself
173
- def self.build_from_hash(attributes)
174
- new.build_from_hash(attributes)
175
- end
176
-
177
- # Builds the object from hash
178
- # @param [Hash] attributes Model attributes in the form of hash
179
- # @return [Object] Returns the model itself
180
- def build_from_hash(attributes)
181
- return nil unless attributes.is_a?(Hash)
182
- self.class.openapi_types.each_pair do |key, type|
183
- if 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 # or else data not found in attributes(hash), not an issue as the data can be optional
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 :DateTime
204
- DateTime.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
- MailSlurpClient.const_get(type).build_from_hash(value)
235
- end
236
- end
237
-
238
- # Returns the string representation of the object
239
- # @return [String] String presentation of the object
240
- def to_s
241
- to_hash.to_s
242
- end
243
-
244
- # to_body is an alias to to_hash (backward compatibility)
245
- # @return [Hash] Returns the object in the form of hash
246
- def to_body
247
- to_hash
248
- end
249
-
250
- # Returns the object in the form of hash
251
- # @return [Hash] Returns the object in the form of hash
252
- def to_hash
253
- hash = {}
254
- self.class.attribute_map.each_pair do |attr, param|
255
- value = self.send(attr)
256
- if value.nil?
257
- is_nullable = self.class.openapi_nullable.include?(attr)
258
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
- end
260
-
261
- hash[param] = _to_hash(value)
262
- end
263
- hash
264
- end
265
-
266
- # Outputs non-array value in the form of hash
267
- # For object, use to_hash. Otherwise, just return the value
268
- # @param [Object] value Any valid value
269
- # @return [Hash] Returns the value in the form of hash
270
- def _to_hash(value)
271
- if value.is_a?(Array)
272
- value.compact.map { |v| _to_hash(v) }
273
- elsif value.is_a?(Hash)
274
- {}.tap do |hash|
275
- value.each { |k, v| hash[k] = _to_hash(v) }
276
- end
277
- elsif value.respond_to? :to_hash
278
- value.to_hash
279
- else
280
- value
281
- end
282
- end
283
- end
284
- end
@@ -1,298 +0,0 @@
1
- =begin
2
- #MailSlurp API
3
-
4
- #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
-
6
- The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module MailSlurpClient
16
- class PageAlias
17
- attr_accessor :content
18
-
19
- attr_accessor :empty
20
-
21
- attr_accessor :first
22
-
23
- attr_accessor :last
24
-
25
- attr_accessor :number
26
-
27
- attr_accessor :number_of_elements
28
-
29
- attr_accessor :pageable
30
-
31
- attr_accessor :size
32
-
33
- attr_accessor :sort
34
-
35
- attr_accessor :total_elements
36
-
37
- attr_accessor :total_pages
38
-
39
- # Attribute mapping from ruby-style variable name to JSON key.
40
- def self.attribute_map
41
- {
42
- :'content' => :'content',
43
- :'empty' => :'empty',
44
- :'first' => :'first',
45
- :'last' => :'last',
46
- :'number' => :'number',
47
- :'number_of_elements' => :'numberOfElements',
48
- :'pageable' => :'pageable',
49
- :'size' => :'size',
50
- :'sort' => :'sort',
51
- :'total_elements' => :'totalElements',
52
- :'total_pages' => :'totalPages'
53
- }
54
- end
55
-
56
- # Attribute type mapping.
57
- def self.openapi_types
58
- {
59
- :'content' => :'Array<ModelAlias>',
60
- :'empty' => :'Boolean',
61
- :'first' => :'Boolean',
62
- :'last' => :'Boolean',
63
- :'number' => :'Integer',
64
- :'number_of_elements' => :'Integer',
65
- :'pageable' => :'Pageable',
66
- :'size' => :'Integer',
67
- :'sort' => :'Sort',
68
- :'total_elements' => :'Integer',
69
- :'total_pages' => :'Integer'
70
- }
71
- end
72
-
73
- # List of attributes with nullable: true
74
- def self.openapi_nullable
75
- Set.new([
76
- ])
77
- end
78
-
79
- # Initializes the object
80
- # @param [Hash] attributes Model attributes in the form of hash
81
- def initialize(attributes = {})
82
- if (!attributes.is_a?(Hash))
83
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::PageAlias` initialize method"
84
- end
85
-
86
- # check to see if the attribute exists and convert string to symbol for hash key
87
- attributes = attributes.each_with_object({}) { |(k, v), h|
88
- if (!self.class.attribute_map.key?(k.to_sym))
89
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::PageAlias`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
- end
91
- h[k.to_sym] = v
92
- }
93
-
94
- if attributes.key?(:'content')
95
- if (value = attributes[:'content']).is_a?(Array)
96
- self.content = value
97
- end
98
- end
99
-
100
- if attributes.key?(:'empty')
101
- self.empty = attributes[:'empty']
102
- end
103
-
104
- if attributes.key?(:'first')
105
- self.first = attributes[:'first']
106
- end
107
-
108
- if attributes.key?(:'last')
109
- self.last = attributes[:'last']
110
- end
111
-
112
- if attributes.key?(:'number')
113
- self.number = attributes[:'number']
114
- end
115
-
116
- if attributes.key?(:'number_of_elements')
117
- self.number_of_elements = attributes[:'number_of_elements']
118
- end
119
-
120
- if attributes.key?(:'pageable')
121
- self.pageable = attributes[:'pageable']
122
- end
123
-
124
- if attributes.key?(:'size')
125
- self.size = attributes[:'size']
126
- end
127
-
128
- if attributes.key?(:'sort')
129
- self.sort = attributes[:'sort']
130
- end
131
-
132
- if attributes.key?(:'total_elements')
133
- self.total_elements = attributes[:'total_elements']
134
- end
135
-
136
- if attributes.key?(:'total_pages')
137
- self.total_pages = attributes[:'total_pages']
138
- end
139
- end
140
-
141
- # Show invalid properties with the reasons. Usually used together with valid?
142
- # @return Array for valid properties with the reasons
143
- def list_invalid_properties
144
- invalid_properties = Array.new
145
- invalid_properties
146
- end
147
-
148
- # Check to see if the all the properties in the model are valid
149
- # @return true if the model is valid
150
- def valid?
151
- true
152
- end
153
-
154
- # Checks equality by comparing each attribute.
155
- # @param [Object] Object to be compared
156
- def ==(o)
157
- return true if self.equal?(o)
158
- self.class == o.class &&
159
- content == o.content &&
160
- empty == o.empty &&
161
- first == o.first &&
162
- last == o.last &&
163
- number == o.number &&
164
- number_of_elements == o.number_of_elements &&
165
- pageable == o.pageable &&
166
- size == o.size &&
167
- sort == o.sort &&
168
- total_elements == o.total_elements &&
169
- total_pages == o.total_pages
170
- end
171
-
172
- # @see the `==` method
173
- # @param [Object] Object to be compared
174
- def eql?(o)
175
- self == o
176
- end
177
-
178
- # Calculates hash code according to all attributes.
179
- # @return [Integer] Hash code
180
- def hash
181
- [content, empty, first, last, number, number_of_elements, pageable, size, sort, total_elements, total_pages].hash
182
- end
183
-
184
- # Builds the object from hash
185
- # @param [Hash] attributes Model attributes in the form of hash
186
- # @return [Object] Returns the model itself
187
- def self.build_from_hash(attributes)
188
- new.build_from_hash(attributes)
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 build_from_hash(attributes)
195
- return nil unless attributes.is_a?(Hash)
196
- self.class.openapi_types.each_pair do |key, type|
197
- if type =~ /\AArray<(.*)>/i
198
- # check to ensure the input is an array given that the attribute
199
- # is documented as an array but the input is not
200
- if attributes[self.class.attribute_map[key]].is_a?(Array)
201
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
202
- end
203
- elsif !attributes[self.class.attribute_map[key]].nil?
204
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
205
- end # or else data not found in attributes(hash), not an issue as the data can be optional
206
- end
207
-
208
- self
209
- end
210
-
211
- # Deserializes the data based on type
212
- # @param string type Data type
213
- # @param string value Value to be deserialized
214
- # @return [Object] Deserialized data
215
- def _deserialize(type, value)
216
- case type.to_sym
217
- when :DateTime
218
- DateTime.parse(value)
219
- when :Date
220
- Date.parse(value)
221
- when :String
222
- value.to_s
223
- when :Integer
224
- value.to_i
225
- when :Float
226
- value.to_f
227
- when :Boolean
228
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
- true
230
- else
231
- false
232
- end
233
- when :Object
234
- # generic object (usually a Hash), return directly
235
- value
236
- when /\AArray<(?<inner_type>.+)>\z/
237
- inner_type = Regexp.last_match[:inner_type]
238
- value.map { |v| _deserialize(inner_type, v) }
239
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
240
- k_type = Regexp.last_match[:k_type]
241
- v_type = Regexp.last_match[:v_type]
242
- {}.tap do |hash|
243
- value.each do |k, v|
244
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
245
- end
246
- end
247
- else # model
248
- MailSlurpClient.const_get(type).build_from_hash(value)
249
- end
250
- end
251
-
252
- # Returns the string representation of the object
253
- # @return [String] String presentation of the object
254
- def to_s
255
- to_hash.to_s
256
- end
257
-
258
- # to_body is an alias to to_hash (backward compatibility)
259
- # @return [Hash] Returns the object in the form of hash
260
- def to_body
261
- to_hash
262
- end
263
-
264
- # Returns the object in the form of hash
265
- # @return [Hash] Returns the object in the form of hash
266
- def to_hash
267
- hash = {}
268
- self.class.attribute_map.each_pair do |attr, param|
269
- value = self.send(attr)
270
- if value.nil?
271
- is_nullable = self.class.openapi_nullable.include?(attr)
272
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
273
- end
274
-
275
- hash[param] = _to_hash(value)
276
- end
277
- hash
278
- end
279
-
280
- # Outputs non-array value in the form of hash
281
- # For object, use to_hash. Otherwise, just return the value
282
- # @param [Object] value Any valid value
283
- # @return [Hash] Returns the value in the form of hash
284
- def _to_hash(value)
285
- if value.is_a?(Array)
286
- value.compact.map { |v| _to_hash(v) }
287
- elsif value.is_a?(Hash)
288
- {}.tap do |hash|
289
- value.each { |k, v| hash[k] = _to_hash(v) }
290
- end
291
- elsif value.respond_to? :to_hash
292
- value.to_hash
293
- else
294
- value
295
- end
296
- end
297
- end
298
- end