mailslurp_client 7.0.7 → 8.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +19 -3
  3. metadata +14 -345
  4. data/Gemfile +0 -9
  5. data/LICENSE +0 -22
  6. data/README.md +0 -226
  7. data/Rakefile +0 -10
  8. data/docs/AttachmentControllerApi.md +0 -124
  9. data/docs/AttachmentMetaData.md +0 -23
  10. data/docs/BasicAuthOptions.md +0 -19
  11. data/docs/BulkActionsControllerApi.md +0 -165
  12. data/docs/BulkSendEmailOptions.md +0 -19
  13. data/docs/CommonActionsControllerApi.md +0 -167
  14. data/docs/ContactControllerApi.md +0 -274
  15. data/docs/ContactDto.md +0 -31
  16. data/docs/ContactProjection.md +0 -27
  17. data/docs/CreateContactOptions.md +0 -31
  18. data/docs/CreateDomainOptions.md +0 -17
  19. data/docs/CreateGroupOptions.md +0 -19
  20. data/docs/CreateTemplateOptions.md +0 -19
  21. data/docs/CreateWebhookOptions.md +0 -21
  22. data/docs/DomainControllerApi.md +0 -223
  23. data/docs/DomainDto.md +0 -29
  24. data/docs/DomainPreview.md +0 -21
  25. data/docs/Email.md +0 -49
  26. data/docs/EmailAnalysis.md +0 -25
  27. data/docs/EmailControllerApi.md +0 -740
  28. data/docs/EmailPreview.md +0 -31
  29. data/docs/EmailProjection.md +0 -33
  30. data/docs/ForwardEmailOptions.md +0 -23
  31. data/docs/GroupContactsDto.md +0 -19
  32. data/docs/GroupControllerApi.md +0 -437
  33. data/docs/GroupDto.md +0 -23
  34. data/docs/GroupProjection.md +0 -23
  35. data/docs/HTMLValidationResult.md +0 -21
  36. data/docs/Inbox.md +0 -33
  37. data/docs/InboxControllerApi.md +0 -652
  38. data/docs/InboxProjection.md +0 -29
  39. data/docs/JsonNode.md +0 -59
  40. data/docs/MatchOption.md +0 -21
  41. data/docs/MatchOptions.md +0 -17
  42. data/docs/PageContactProjection.md +0 -37
  43. data/docs/PageEmailPreview.md +0 -37
  44. data/docs/PageEmailProjection.md +0 -37
  45. data/docs/PageGroupProjection.md +0 -37
  46. data/docs/PageInboxProjection.md +0 -37
  47. data/docs/PageTemplateProjection.md +0 -37
  48. data/docs/PageWebhookProjection.md +0 -37
  49. data/docs/Pageable.md +0 -27
  50. data/docs/RawEmailJson.md +0 -17
  51. data/docs/SendEmailOptions.md +0 -45
  52. data/docs/SetInboxFavouritedOptions.md +0 -17
  53. data/docs/Sort.md +0 -21
  54. data/docs/TemplateControllerApi.md +0 -274
  55. data/docs/TemplateDto.md +0 -25
  56. data/docs/TemplateProjection.md +0 -25
  57. data/docs/TemplateVariable.md +0 -19
  58. data/docs/UnreadCount.md +0 -17
  59. data/docs/UpdateGroupContacts.md +0 -17
  60. data/docs/UpdateInboxOptions.md +0 -25
  61. data/docs/UploadAttachmentOptions.md +0 -21
  62. data/docs/ValidationDto.md +0 -19
  63. data/docs/ValidationMessage.md +0 -19
  64. data/docs/WaitForConditions.md +0 -29
  65. data/docs/WaitForControllerApi.md +0 -317
  66. data/docs/WebhookControllerApi.md +0 -339
  67. data/docs/WebhookDto.md +0 -33
  68. data/docs/WebhookProjection.md +0 -27
  69. data/docs/WebhookTestRequest.md +0 -23
  70. data/docs/WebhookTestResponse.md +0 -19
  71. data/docs/WebhookTestResult.md +0 -21
  72. data/git_push.sh +0 -58
  73. data/lib/mailslurp_client/api/attachment_controller_api.rb +0 -157
  74. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +0 -203
  75. data/lib/mailslurp_client/api/common_actions_controller_api.rb +0 -201
  76. data/lib/mailslurp_client/api/contact_controller_api.rb +0 -323
  77. data/lib/mailslurp_client/api/domain_controller_api.rb +0 -264
  78. data/lib/mailslurp_client/api/email_controller_api.rb +0 -852
  79. data/lib/mailslurp_client/api/group_controller_api.rb +0 -519
  80. data/lib/mailslurp_client/api/inbox_controller_api.rb +0 -763
  81. data/lib/mailslurp_client/api/template_controller_api.rb +0 -323
  82. data/lib/mailslurp_client/api/wait_for_controller_api.rb +0 -359
  83. data/lib/mailslurp_client/api/webhook_controller_api.rb +0 -405
  84. data/lib/mailslurp_client/api_client.rb +0 -386
  85. data/lib/mailslurp_client/api_error.rb +0 -57
  86. data/lib/mailslurp_client/configuration.rb +0 -248
  87. data/lib/mailslurp_client/models/attachment_meta_data.rb +0 -253
  88. data/lib/mailslurp_client/models/basic_auth_options.rb +0 -226
  89. data/lib/mailslurp_client/models/bulk_send_email_options.rb +0 -224
  90. data/lib/mailslurp_client/models/contact_dto.rb +0 -288
  91. data/lib/mailslurp_client/models/contact_projection.rb +0 -261
  92. data/lib/mailslurp_client/models/create_contact_options.rb +0 -277
  93. data/lib/mailslurp_client/models/create_domain_options.rb +0 -208
  94. data/lib/mailslurp_client/models/create_group_options.rb +0 -220
  95. data/lib/mailslurp_client/models/create_template_options.rb +0 -225
  96. data/lib/mailslurp_client/models/create_webhook_options.rb +0 -227
  97. data/lib/mailslurp_client/models/domain_dto.rb +0 -296
  98. data/lib/mailslurp_client/models/domain_preview.rb +0 -240
  99. data/lib/mailslurp_client/models/email.rb +0 -376
  100. data/lib/mailslurp_client/models/email_analysis.rb +0 -243
  101. data/lib/mailslurp_client/models/email_preview.rb +0 -286
  102. data/lib/mailslurp_client/models/email_projection.rb +0 -306
  103. data/lib/mailslurp_client/models/forward_email_options.rb +0 -245
  104. data/lib/mailslurp_client/models/group_contacts_dto.rb +0 -227
  105. data/lib/mailslurp_client/models/group_dto.rb +0 -248
  106. data/lib/mailslurp_client/models/group_projection.rb +0 -248
  107. data/lib/mailslurp_client/models/html_validation_result.rb +0 -243
  108. data/lib/mailslurp_client/models/inbox.rb +0 -290
  109. data/lib/mailslurp_client/models/inbox_projection.rb +0 -272
  110. data/lib/mailslurp_client/models/json_node.rb +0 -429
  111. data/lib/mailslurp_client/models/match_option.rb +0 -274
  112. data/lib/mailslurp_client/models/match_options.rb +0 -210
  113. data/lib/mailslurp_client/models/page_contact_projection.rb +0 -298
  114. data/lib/mailslurp_client/models/page_email_preview.rb +0 -298
  115. data/lib/mailslurp_client/models/page_email_projection.rb +0 -298
  116. data/lib/mailslurp_client/models/page_group_projection.rb +0 -298
  117. data/lib/mailslurp_client/models/page_inbox_projection.rb +0 -298
  118. data/lib/mailslurp_client/models/page_template_projection.rb +0 -298
  119. data/lib/mailslurp_client/models/page_webhook_projection.rb +0 -298
  120. data/lib/mailslurp_client/models/pageable.rb +0 -251
  121. data/lib/mailslurp_client/models/raw_email_json.rb +0 -211
  122. data/lib/mailslurp_client/models/send_email_options.rb +0 -392
  123. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +0 -208
  124. data/lib/mailslurp_client/models/sort.rb +0 -224
  125. data/lib/mailslurp_client/models/template_dto.rb +0 -269
  126. data/lib/mailslurp_client/models/template_projection.rb +0 -269
  127. data/lib/mailslurp_client/models/template_variable.rb +0 -259
  128. data/lib/mailslurp_client/models/unread_count.rb +0 -211
  129. data/lib/mailslurp_client/models/update_group_contacts.rb +0 -213
  130. data/lib/mailslurp_client/models/update_inbox_options.rb +0 -250
  131. data/lib/mailslurp_client/models/upload_attachment_options.rb +0 -228
  132. data/lib/mailslurp_client/models/validation_dto.rb +0 -225
  133. data/lib/mailslurp_client/models/validation_message.rb +0 -220
  134. data/lib/mailslurp_client/models/wait_for_conditions.rb +0 -315
  135. data/lib/mailslurp_client/models/webhook_dto.rb +0 -326
  136. data/lib/mailslurp_client/models/webhook_projection.rb +0 -277
  137. data/lib/mailslurp_client/models/webhook_test_request.rb +0 -284
  138. data/lib/mailslurp_client/models/webhook_test_response.rb +0 -215
  139. data/lib/mailslurp_client/models/webhook_test_result.rb +0 -235
  140. data/lib/mailslurp_client/version.rb +0 -15
  141. data/mailslurp_client.gemspec +0 -39
  142. data/spec/api/attachment_controller_api_spec.rb +0 -61
  143. data/spec/api/bulk_actions_controller_api_spec.rb +0 -68
  144. data/spec/api/common_actions_controller_api_spec.rb +0 -129
  145. data/spec/api/contact_controller_api_spec.rb +0 -91
  146. data/spec/api/domain_controller_api_spec.rb +0 -82
  147. data/spec/api/email_controller_api_spec.rb +0 -162
  148. data/spec/api/group_controller_api_spec.rb +0 -126
  149. data/spec/api/inbox_controller_api_spec.rb +0 -172
  150. data/spec/api/template_controller_api_spec.rb +0 -91
  151. data/spec/api/wait_for_controller_api_spec.rb +0 -107
  152. data/spec/api/webhook_controller_api_spec.rb +0 -107
  153. data/spec/api_client_spec.rb +0 -226
  154. data/spec/configuration_spec.rb +0 -42
  155. data/spec/models/attachment_meta_data_spec.rb +0 -59
  156. data/spec/models/basic_auth_options_spec.rb +0 -47
  157. data/spec/models/bulk_send_email_options_spec.rb +0 -47
  158. data/spec/models/contact_dto_spec.rb +0 -83
  159. data/spec/models/contact_projection_spec.rb +0 -71
  160. data/spec/models/create_contact_options_spec.rb +0 -83
  161. data/spec/models/create_domain_options_spec.rb +0 -41
  162. data/spec/models/create_group_options_spec.rb +0 -47
  163. data/spec/models/create_template_options_spec.rb +0 -47
  164. data/spec/models/create_webhook_options_spec.rb +0 -53
  165. data/spec/models/domain_dto_spec.rb +0 -77
  166. data/spec/models/domain_preview_spec.rb +0 -53
  167. data/spec/models/email_analysis_spec.rb +0 -65
  168. data/spec/models/email_preview_spec.rb +0 -83
  169. data/spec/models/email_projection_spec.rb +0 -89
  170. data/spec/models/email_spec.rb +0 -137
  171. data/spec/models/forward_email_options_spec.rb +0 -59
  172. data/spec/models/group_contacts_dto_spec.rb +0 -47
  173. data/spec/models/group_dto_spec.rb +0 -59
  174. data/spec/models/group_projection_spec.rb +0 -59
  175. data/spec/models/html_validation_result_spec.rb +0 -53
  176. data/spec/models/inbox_projection_spec.rb +0 -77
  177. data/spec/models/inbox_spec.rb +0 -89
  178. data/spec/models/json_node_spec.rb +0 -171
  179. data/spec/models/match_option_spec.rb +0 -61
  180. data/spec/models/match_options_spec.rb +0 -41
  181. data/spec/models/page_contact_projection_spec.rb +0 -101
  182. data/spec/models/page_email_preview_spec.rb +0 -101
  183. data/spec/models/page_email_projection_spec.rb +0 -101
  184. data/spec/models/page_group_projection_spec.rb +0 -101
  185. data/spec/models/page_inbox_projection_spec.rb +0 -101
  186. data/spec/models/page_template_projection_spec.rb +0 -101
  187. data/spec/models/page_webhook_projection_spec.rb +0 -101
  188. data/spec/models/pageable_spec.rb +0 -71
  189. data/spec/models/raw_email_json_spec.rb +0 -41
  190. data/spec/models/send_email_options_spec.rb +0 -129
  191. data/spec/models/set_inbox_favourited_options_spec.rb +0 -41
  192. data/spec/models/sort_spec.rb +0 -53
  193. data/spec/models/template_dto_spec.rb +0 -65
  194. data/spec/models/template_projection_spec.rb +0 -65
  195. data/spec/models/template_variable_spec.rb +0 -51
  196. data/spec/models/unread_count_spec.rb +0 -41
  197. data/spec/models/update_group_contacts_spec.rb +0 -41
  198. data/spec/models/update_inbox_options_spec.rb +0 -65
  199. data/spec/models/upload_attachment_options_spec.rb +0 -53
  200. data/spec/models/validation_dto_spec.rb +0 -47
  201. data/spec/models/validation_message_spec.rb +0 -47
  202. data/spec/models/wait_for_conditions_spec.rb +0 -85
  203. data/spec/models/webhook_dto_spec.rb +0 -93
  204. data/spec/models/webhook_projection_spec.rb +0 -71
  205. data/spec/models/webhook_test_request_spec.rb +0 -63
  206. data/spec/models/webhook_test_response_spec.rb +0 -47
  207. data/spec/models/webhook_test_result_spec.rb +0 -53
  208. data/spec/spec_helper.rb +0 -111
@@ -1,429 +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: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
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 JsonNode
17
- attr_accessor :array
18
-
19
- attr_accessor :big_decimal
20
-
21
- attr_accessor :big_integer
22
-
23
- attr_accessor :binary
24
-
25
- attr_accessor :boolean
26
-
27
- attr_accessor :container_node
28
-
29
- attr_accessor :double
30
-
31
- attr_accessor :empty
32
-
33
- attr_accessor :float
34
-
35
- attr_accessor :floating_point_number
36
-
37
- attr_accessor :int
38
-
39
- attr_accessor :integral_number
40
-
41
- attr_accessor :long
42
-
43
- attr_accessor :missing_node
44
-
45
- attr_accessor :node_type
46
-
47
- attr_accessor :null
48
-
49
- attr_accessor :number
50
-
51
- attr_accessor :object
52
-
53
- attr_accessor :pojo
54
-
55
- attr_accessor :short
56
-
57
- attr_accessor :textual
58
-
59
- attr_accessor :value_node
60
-
61
- class EnumAttributeValidator
62
- attr_reader :datatype
63
- attr_reader :allowable_values
64
-
65
- def initialize(datatype, allowable_values)
66
- @allowable_values = allowable_values.map do |value|
67
- case datatype.to_s
68
- when /Integer/i
69
- value.to_i
70
- when /Float/i
71
- value.to_f
72
- else
73
- value
74
- end
75
- end
76
- end
77
-
78
- def valid?(value)
79
- !value || allowable_values.include?(value)
80
- end
81
- end
82
-
83
- # Attribute mapping from ruby-style variable name to JSON key.
84
- def self.attribute_map
85
- {
86
- :'array' => :'array',
87
- :'big_decimal' => :'bigDecimal',
88
- :'big_integer' => :'bigInteger',
89
- :'binary' => :'binary',
90
- :'boolean' => :'boolean',
91
- :'container_node' => :'containerNode',
92
- :'double' => :'double',
93
- :'empty' => :'empty',
94
- :'float' => :'float',
95
- :'floating_point_number' => :'floatingPointNumber',
96
- :'int' => :'int',
97
- :'integral_number' => :'integralNumber',
98
- :'long' => :'long',
99
- :'missing_node' => :'missingNode',
100
- :'node_type' => :'nodeType',
101
- :'null' => :'null',
102
- :'number' => :'number',
103
- :'object' => :'object',
104
- :'pojo' => :'pojo',
105
- :'short' => :'short',
106
- :'textual' => :'textual',
107
- :'value_node' => :'valueNode'
108
- }
109
- end
110
-
111
- # Attribute type mapping.
112
- def self.openapi_types
113
- {
114
- :'array' => :'Boolean',
115
- :'big_decimal' => :'Boolean',
116
- :'big_integer' => :'Boolean',
117
- :'binary' => :'Boolean',
118
- :'boolean' => :'Boolean',
119
- :'container_node' => :'Boolean',
120
- :'double' => :'Boolean',
121
- :'empty' => :'Boolean',
122
- :'float' => :'Boolean',
123
- :'floating_point_number' => :'Boolean',
124
- :'int' => :'Boolean',
125
- :'integral_number' => :'Boolean',
126
- :'long' => :'Boolean',
127
- :'missing_node' => :'Boolean',
128
- :'node_type' => :'String',
129
- :'null' => :'Boolean',
130
- :'number' => :'Boolean',
131
- :'object' => :'Boolean',
132
- :'pojo' => :'Boolean',
133
- :'short' => :'Boolean',
134
- :'textual' => :'Boolean',
135
- :'value_node' => :'Boolean'
136
- }
137
- end
138
-
139
- # List of attributes with nullable: true
140
- def self.openapi_nullable
141
- Set.new([
142
- ])
143
- end
144
-
145
- # Initializes the object
146
- # @param [Hash] attributes Model attributes in the form of hash
147
- def initialize(attributes = {})
148
- if (!attributes.is_a?(Hash))
149
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::JsonNode` initialize method"
150
- end
151
-
152
- # check to see if the attribute exists and convert string to symbol for hash key
153
- attributes = attributes.each_with_object({}) { |(k, v), h|
154
- if (!self.class.attribute_map.key?(k.to_sym))
155
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::JsonNode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
156
- end
157
- h[k.to_sym] = v
158
- }
159
-
160
- if attributes.key?(:'array')
161
- self.array = attributes[:'array']
162
- end
163
-
164
- if attributes.key?(:'big_decimal')
165
- self.big_decimal = attributes[:'big_decimal']
166
- end
167
-
168
- if attributes.key?(:'big_integer')
169
- self.big_integer = attributes[:'big_integer']
170
- end
171
-
172
- if attributes.key?(:'binary')
173
- self.binary = attributes[:'binary']
174
- end
175
-
176
- if attributes.key?(:'boolean')
177
- self.boolean = attributes[:'boolean']
178
- end
179
-
180
- if attributes.key?(:'container_node')
181
- self.container_node = attributes[:'container_node']
182
- end
183
-
184
- if attributes.key?(:'double')
185
- self.double = attributes[:'double']
186
- end
187
-
188
- if attributes.key?(:'empty')
189
- self.empty = attributes[:'empty']
190
- end
191
-
192
- if attributes.key?(:'float')
193
- self.float = attributes[:'float']
194
- end
195
-
196
- if attributes.key?(:'floating_point_number')
197
- self.floating_point_number = attributes[:'floating_point_number']
198
- end
199
-
200
- if attributes.key?(:'int')
201
- self.int = attributes[:'int']
202
- end
203
-
204
- if attributes.key?(:'integral_number')
205
- self.integral_number = attributes[:'integral_number']
206
- end
207
-
208
- if attributes.key?(:'long')
209
- self.long = attributes[:'long']
210
- end
211
-
212
- if attributes.key?(:'missing_node')
213
- self.missing_node = attributes[:'missing_node']
214
- end
215
-
216
- if attributes.key?(:'node_type')
217
- self.node_type = attributes[:'node_type']
218
- end
219
-
220
- if attributes.key?(:'null')
221
- self.null = attributes[:'null']
222
- end
223
-
224
- if attributes.key?(:'number')
225
- self.number = attributes[:'number']
226
- end
227
-
228
- if attributes.key?(:'object')
229
- self.object = attributes[:'object']
230
- end
231
-
232
- if attributes.key?(:'pojo')
233
- self.pojo = attributes[:'pojo']
234
- end
235
-
236
- if attributes.key?(:'short')
237
- self.short = attributes[:'short']
238
- end
239
-
240
- if attributes.key?(:'textual')
241
- self.textual = attributes[:'textual']
242
- end
243
-
244
- if attributes.key?(:'value_node')
245
- self.value_node = attributes[:'value_node']
246
- end
247
- end
248
-
249
- # Show invalid properties with the reasons. Usually used together with valid?
250
- # @return Array for valid properties with the reasons
251
- def list_invalid_properties
252
- invalid_properties = Array.new
253
- invalid_properties
254
- end
255
-
256
- # Check to see if the all the properties in the model are valid
257
- # @return true if the model is valid
258
- def valid?
259
- node_type_validator = EnumAttributeValidator.new('String', ["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"])
260
- return false unless node_type_validator.valid?(@node_type)
261
- true
262
- end
263
-
264
- # Custom attribute writer method checking allowed values (enum).
265
- # @param [Object] node_type Object to be assigned
266
- def node_type=(node_type)
267
- validator = EnumAttributeValidator.new('String', ["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"])
268
- unless validator.valid?(node_type)
269
- fail ArgumentError, "invalid value for \"node_type\", must be one of #{validator.allowable_values}."
270
- end
271
- @node_type = node_type
272
- end
273
-
274
- # Checks equality by comparing each attribute.
275
- # @param [Object] Object to be compared
276
- def ==(o)
277
- return true if self.equal?(o)
278
- self.class == o.class &&
279
- array == o.array &&
280
- big_decimal == o.big_decimal &&
281
- big_integer == o.big_integer &&
282
- binary == o.binary &&
283
- boolean == o.boolean &&
284
- container_node == o.container_node &&
285
- double == o.double &&
286
- empty == o.empty &&
287
- float == o.float &&
288
- floating_point_number == o.floating_point_number &&
289
- int == o.int &&
290
- integral_number == o.integral_number &&
291
- long == o.long &&
292
- missing_node == o.missing_node &&
293
- node_type == o.node_type &&
294
- null == o.null &&
295
- number == o.number &&
296
- object == o.object &&
297
- pojo == o.pojo &&
298
- short == o.short &&
299
- textual == o.textual &&
300
- value_node == o.value_node
301
- end
302
-
303
- # @see the `==` method
304
- # @param [Object] Object to be compared
305
- def eql?(o)
306
- self == o
307
- end
308
-
309
- # Calculates hash code according to all attributes.
310
- # @return [Integer] Hash code
311
- def hash
312
- [array, big_decimal, big_integer, binary, boolean, container_node, double, empty, float, floating_point_number, int, integral_number, long, missing_node, node_type, null, number, object, pojo, short, textual, value_node].hash
313
- end
314
-
315
- # Builds the object from hash
316
- # @param [Hash] attributes Model attributes in the form of hash
317
- # @return [Object] Returns the model itself
318
- def self.build_from_hash(attributes)
319
- new.build_from_hash(attributes)
320
- end
321
-
322
- # Builds the object from hash
323
- # @param [Hash] attributes Model attributes in the form of hash
324
- # @return [Object] Returns the model itself
325
- def build_from_hash(attributes)
326
- return nil unless attributes.is_a?(Hash)
327
- self.class.openapi_types.each_pair do |key, type|
328
- if type =~ /\AArray<(.*)>/i
329
- # check to ensure the input is an array given that the attribute
330
- # is documented as an array but the input is not
331
- if attributes[self.class.attribute_map[key]].is_a?(Array)
332
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
333
- end
334
- elsif !attributes[self.class.attribute_map[key]].nil?
335
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
336
- end # or else data not found in attributes(hash), not an issue as the data can be optional
337
- end
338
-
339
- self
340
- end
341
-
342
- # Deserializes the data based on type
343
- # @param string type Data type
344
- # @param string value Value to be deserialized
345
- # @return [Object] Deserialized data
346
- def _deserialize(type, value)
347
- case type.to_sym
348
- when :DateTime
349
- DateTime.parse(value)
350
- when :Date
351
- Date.parse(value)
352
- when :String
353
- value.to_s
354
- when :Integer
355
- value.to_i
356
- when :Float
357
- value.to_f
358
- when :Boolean
359
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
360
- true
361
- else
362
- false
363
- end
364
- when :Object
365
- # generic object (usually a Hash), return directly
366
- value
367
- when /\AArray<(?<inner_type>.+)>\z/
368
- inner_type = Regexp.last_match[:inner_type]
369
- value.map { |v| _deserialize(inner_type, v) }
370
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
371
- k_type = Regexp.last_match[:k_type]
372
- v_type = Regexp.last_match[:v_type]
373
- {}.tap do |hash|
374
- value.each do |k, v|
375
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
376
- end
377
- end
378
- else # model
379
- MailSlurpClient.const_get(type).build_from_hash(value)
380
- end
381
- end
382
-
383
- # Returns the string representation of the object
384
- # @return [String] String presentation of the object
385
- def to_s
386
- to_hash.to_s
387
- end
388
-
389
- # to_body is an alias to to_hash (backward compatibility)
390
- # @return [Hash] Returns the object in the form of hash
391
- def to_body
392
- to_hash
393
- end
394
-
395
- # Returns the object in the form of hash
396
- # @return [Hash] Returns the object in the form of hash
397
- def to_hash
398
- hash = {}
399
- self.class.attribute_map.each_pair do |attr, param|
400
- value = self.send(attr)
401
- if value.nil?
402
- is_nullable = self.class.openapi_nullable.include?(attr)
403
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
404
- end
405
-
406
- hash[param] = _to_hash(value)
407
- end
408
- hash
409
- end
410
-
411
- # Outputs non-array value in the form of hash
412
- # For object, use to_hash. Otherwise, just return the value
413
- # @param [Object] value Any valid value
414
- # @return [Hash] Returns the value in the form of hash
415
- def _to_hash(value)
416
- if value.is_a?(Array)
417
- value.compact.map { |v| _to_hash(v) }
418
- elsif value.is_a?(Hash)
419
- {}.tap do |hash|
420
- value.each { |k, v| hash[k] = _to_hash(v) }
421
- end
422
- elsif value.respond_to? :to_hash
423
- value.to_hash
424
- else
425
- value
426
- end
427
- end
428
- end
429
- end
@@ -1,274 +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: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
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
- # Options for matching emails in an inbox. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `SUBJECT` should `CONTAIN` value.
17
- class MatchOption
18
- # The email property to match on. One of SUBJECT, TO, BCC, CC or FROM
19
- attr_accessor :field
20
-
21
- # What criteria to apply. CONTAIN or EQUAL. Note CONTAIN is recommended due to some SMTP servers adding new lines to fields and body content.
22
- attr_accessor :should
23
-
24
- # The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed.
25
- attr_accessor :value
26
-
27
- class EnumAttributeValidator
28
- attr_reader :datatype
29
- attr_reader :allowable_values
30
-
31
- def initialize(datatype, allowable_values)
32
- @allowable_values = allowable_values.map do |value|
33
- case datatype.to_s
34
- when /Integer/i
35
- value.to_i
36
- when /Float/i
37
- value.to_f
38
- else
39
- value
40
- end
41
- end
42
- end
43
-
44
- def valid?(value)
45
- !value || allowable_values.include?(value)
46
- end
47
- end
48
-
49
- # Attribute mapping from ruby-style variable name to JSON key.
50
- def self.attribute_map
51
- {
52
- :'field' => :'field',
53
- :'should' => :'should',
54
- :'value' => :'value'
55
- }
56
- end
57
-
58
- # Attribute type mapping.
59
- def self.openapi_types
60
- {
61
- :'field' => :'String',
62
- :'should' => :'String',
63
- :'value' => :'String'
64
- }
65
- end
66
-
67
- # List of attributes with nullable: true
68
- def self.openapi_nullable
69
- Set.new([
70
- ])
71
- end
72
-
73
- # Initializes the object
74
- # @param [Hash] attributes Model attributes in the form of hash
75
- def initialize(attributes = {})
76
- if (!attributes.is_a?(Hash))
77
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::MatchOption` initialize method"
78
- end
79
-
80
- # check to see if the attribute exists and convert string to symbol for hash key
81
- attributes = attributes.each_with_object({}) { |(k, v), h|
82
- if (!self.class.attribute_map.key?(k.to_sym))
83
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::MatchOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
- end
85
- h[k.to_sym] = v
86
- }
87
-
88
- if attributes.key?(:'field')
89
- self.field = attributes[:'field']
90
- end
91
-
92
- if attributes.key?(:'should')
93
- self.should = attributes[:'should']
94
- end
95
-
96
- if attributes.key?(:'value')
97
- self.value = attributes[:'value']
98
- end
99
- end
100
-
101
- # Show invalid properties with the reasons. Usually used together with valid?
102
- # @return Array for valid properties with the reasons
103
- def list_invalid_properties
104
- invalid_properties = Array.new
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
- field_validator = EnumAttributeValidator.new('String', ["SUBJECT", "TO", "BCC", "CC", "FROM"])
112
- return false unless field_validator.valid?(@field)
113
- should_validator = EnumAttributeValidator.new('String', ["CONTAIN", "EQUAL"])
114
- return false unless should_validator.valid?(@should)
115
- true
116
- end
117
-
118
- # Custom attribute writer method checking allowed values (enum).
119
- # @param [Object] field Object to be assigned
120
- def field=(field)
121
- validator = EnumAttributeValidator.new('String', ["SUBJECT", "TO", "BCC", "CC", "FROM"])
122
- unless validator.valid?(field)
123
- fail ArgumentError, "invalid value for \"field\", must be one of #{validator.allowable_values}."
124
- end
125
- @field = field
126
- end
127
-
128
- # Custom attribute writer method checking allowed values (enum).
129
- # @param [Object] should Object to be assigned
130
- def should=(should)
131
- validator = EnumAttributeValidator.new('String', ["CONTAIN", "EQUAL"])
132
- unless validator.valid?(should)
133
- fail ArgumentError, "invalid value for \"should\", must be one of #{validator.allowable_values}."
134
- end
135
- @should = should
136
- end
137
-
138
- # Checks equality by comparing each attribute.
139
- # @param [Object] Object to be compared
140
- def ==(o)
141
- return true if self.equal?(o)
142
- self.class == o.class &&
143
- field == o.field &&
144
- should == o.should &&
145
- value == o.value
146
- end
147
-
148
- # @see the `==` method
149
- # @param [Object] Object to be compared
150
- def eql?(o)
151
- self == o
152
- end
153
-
154
- # Calculates hash code according to all attributes.
155
- # @return [Integer] Hash code
156
- def hash
157
- [field, should, value].hash
158
- end
159
-
160
- # Builds the object from hash
161
- # @param [Hash] attributes Model attributes in the form of hash
162
- # @return [Object] Returns the model itself
163
- def self.build_from_hash(attributes)
164
- new.build_from_hash(attributes)
165
- end
166
-
167
- # Builds the object from hash
168
- # @param [Hash] attributes Model attributes in the form of hash
169
- # @return [Object] Returns the model itself
170
- def build_from_hash(attributes)
171
- return nil unless attributes.is_a?(Hash)
172
- self.class.openapi_types.each_pair do |key, type|
173
- if type =~ /\AArray<(.*)>/i
174
- # check to ensure the input is an array given that the attribute
175
- # is documented as an array but the input is not
176
- if attributes[self.class.attribute_map[key]].is_a?(Array)
177
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
- end
179
- elsif !attributes[self.class.attribute_map[key]].nil?
180
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
- end # or else data not found in attributes(hash), not an issue as the data can be optional
182
- end
183
-
184
- self
185
- end
186
-
187
- # Deserializes the data based on type
188
- # @param string type Data type
189
- # @param string value Value to be deserialized
190
- # @return [Object] Deserialized data
191
- def _deserialize(type, value)
192
- case type.to_sym
193
- when :DateTime
194
- DateTime.parse(value)
195
- when :Date
196
- Date.parse(value)
197
- when :String
198
- value.to_s
199
- when :Integer
200
- value.to_i
201
- when :Float
202
- value.to_f
203
- when :Boolean
204
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
- true
206
- else
207
- false
208
- end
209
- when :Object
210
- # generic object (usually a Hash), return directly
211
- value
212
- when /\AArray<(?<inner_type>.+)>\z/
213
- inner_type = Regexp.last_match[:inner_type]
214
- value.map { |v| _deserialize(inner_type, v) }
215
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
- k_type = Regexp.last_match[:k_type]
217
- v_type = Regexp.last_match[:v_type]
218
- {}.tap do |hash|
219
- value.each do |k, v|
220
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
- end
222
- end
223
- else # model
224
- MailSlurpClient.const_get(type).build_from_hash(value)
225
- end
226
- end
227
-
228
- # Returns the string representation of the object
229
- # @return [String] String presentation of the object
230
- def to_s
231
- to_hash.to_s
232
- end
233
-
234
- # to_body is an alias to to_hash (backward compatibility)
235
- # @return [Hash] Returns the object in the form of hash
236
- def to_body
237
- to_hash
238
- end
239
-
240
- # Returns the object in the form of hash
241
- # @return [Hash] Returns the object in the form of hash
242
- def to_hash
243
- hash = {}
244
- self.class.attribute_map.each_pair do |attr, param|
245
- value = self.send(attr)
246
- if value.nil?
247
- is_nullable = self.class.openapi_nullable.include?(attr)
248
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
249
- end
250
-
251
- hash[param] = _to_hash(value)
252
- end
253
- hash
254
- end
255
-
256
- # Outputs non-array value in the form of hash
257
- # For object, use to_hash. Otherwise, just return the value
258
- # @param [Object] value Any valid value
259
- # @return [Hash] Returns the value in the form of hash
260
- def _to_hash(value)
261
- if value.is_a?(Array)
262
- value.compact.map { |v| _to_hash(v) }
263
- elsif value.is_a?(Hash)
264
- {}.tap do |hash|
265
- value.each { |k, v| hash[k] = _to_hash(v) }
266
- end
267
- elsif value.respond_to? :to_hash
268
- value.to_hash
269
- else
270
- value
271
- end
272
- end
273
- end
274
- end