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