mailslurp_client 5.0.0 → 7.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/README.md +127 -40
  4. data/docs/AttachmentControllerApi.md +124 -0
  5. data/docs/AttachmentMetaData.md +23 -0
  6. data/docs/BasicAuthOptions.md +10 -0
  7. data/docs/BulkActionsControllerApi.md +165 -0
  8. data/docs/BulkSendEmailOptions.md +11 -1
  9. data/docs/CommonActionsControllerApi.md +167 -0
  10. data/docs/ContactControllerApi.md +274 -0
  11. data/docs/ContactDto.md +31 -0
  12. data/docs/ContactProjection.md +27 -0
  13. data/docs/CreateContactOptions.md +31 -0
  14. data/docs/CreateDomainOptions.md +17 -0
  15. data/docs/CreateGroupOptions.md +19 -0
  16. data/docs/CreateTemplateOptions.md +19 -0
  17. data/docs/CreateWebhookOptions.md +13 -2
  18. data/docs/DomainControllerApi.md +223 -0
  19. data/docs/DomainDto.md +29 -0
  20. data/docs/DomainPreview.md +21 -0
  21. data/docs/Email.md +40 -15
  22. data/docs/EmailAnalysis.md +18 -5
  23. data/docs/EmailControllerApi.md +740 -0
  24. data/docs/EmailPreview.md +24 -6
  25. data/docs/EmailProjection.md +33 -0
  26. data/docs/ForwardEmailOptions.md +12 -0
  27. data/docs/GroupContactsDto.md +19 -0
  28. data/docs/GroupControllerApi.md +437 -0
  29. data/docs/GroupDto.md +23 -0
  30. data/docs/GroupProjection.md +23 -0
  31. data/docs/HTMLValidationResult.md +21 -0
  32. data/docs/Inbox.md +26 -4
  33. data/docs/InboxControllerApi.md +652 -0
  34. data/docs/InboxProjection.md +29 -0
  35. data/docs/JsonNode.md +59 -0
  36. data/docs/MatchOption.md +13 -2
  37. data/docs/MatchOptions.md +9 -0
  38. data/docs/PageContactProjection.md +37 -0
  39. data/docs/PageEmailPreview.md +37 -0
  40. data/docs/PageEmailProjection.md +37 -0
  41. data/docs/PageGroupProjection.md +37 -0
  42. data/docs/PageInboxProjection.md +37 -0
  43. data/docs/PageTemplateProjection.md +37 -0
  44. data/docs/PageWebhookProjection.md +37 -0
  45. data/docs/Pageable.md +27 -0
  46. data/docs/RawEmailJson.md +17 -0
  47. data/docs/SendEmailOptions.md +33 -6
  48. data/docs/SetInboxFavouritedOptions.md +17 -0
  49. data/docs/Sort.md +21 -0
  50. data/docs/TemplateControllerApi.md +274 -0
  51. data/docs/TemplateDto.md +25 -0
  52. data/docs/TemplateProjection.md +25 -0
  53. data/docs/TemplateVariable.md +19 -0
  54. data/docs/UnreadCount.md +17 -0
  55. data/docs/UpdateGroupContacts.md +17 -0
  56. data/docs/UpdateInboxOptions.md +25 -0
  57. data/docs/UploadAttachmentOptions.md +12 -1
  58. data/docs/ValidationDto.md +19 -0
  59. data/docs/ValidationMessage.md +19 -0
  60. data/docs/WaitForConditions.md +29 -0
  61. data/docs/WaitForControllerApi.md +317 -0
  62. data/docs/WebhookControllerApi.md +339 -0
  63. data/docs/WebhookDto.md +33 -0
  64. data/docs/WebhookProjection.md +27 -0
  65. data/docs/WebhookTestRequest.md +23 -0
  66. data/docs/WebhookTestResponse.md +19 -0
  67. data/docs/WebhookTestResult.md +21 -0
  68. data/git_push.sh +10 -7
  69. data/lib/mailslurp_client.rb +56 -7
  70. data/lib/mailslurp_client/api/attachment_controller_api.rb +157 -0
  71. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +203 -0
  72. data/lib/mailslurp_client/api/common_actions_controller_api.rb +201 -0
  73. data/lib/mailslurp_client/api/contact_controller_api.rb +323 -0
  74. data/lib/mailslurp_client/api/domain_controller_api.rb +264 -0
  75. data/lib/mailslurp_client/api/email_controller_api.rb +852 -0
  76. data/lib/mailslurp_client/api/group_controller_api.rb +519 -0
  77. data/lib/mailslurp_client/api/inbox_controller_api.rb +763 -0
  78. data/lib/mailslurp_client/api/template_controller_api.rb +323 -0
  79. data/lib/mailslurp_client/api/wait_for_controller_api.rb +359 -0
  80. data/lib/mailslurp_client/api/webhook_controller_api.rb +405 -0
  81. data/lib/mailslurp_client/api_client.rb +36 -39
  82. data/lib/mailslurp_client/api_error.rb +23 -4
  83. data/lib/mailslurp_client/configuration.rb +8 -11
  84. data/lib/mailslurp_client/models/attachment_meta_data.rb +253 -0
  85. data/lib/mailslurp_client/models/basic_auth_options.rb +39 -15
  86. data/lib/mailslurp_client/models/bulk_send_email_options.rb +42 -19
  87. data/lib/mailslurp_client/models/contact_dto.rb +288 -0
  88. data/lib/mailslurp_client/models/contact_projection.rb +261 -0
  89. data/lib/mailslurp_client/models/create_contact_options.rb +277 -0
  90. data/lib/mailslurp_client/models/create_domain_options.rb +208 -0
  91. data/lib/mailslurp_client/models/create_group_options.rb +220 -0
  92. data/lib/mailslurp_client/models/create_template_options.rb +225 -0
  93. data/lib/mailslurp_client/models/create_webhook_options.rb +54 -29
  94. data/lib/mailslurp_client/models/domain_dto.rb +296 -0
  95. data/lib/mailslurp_client/models/domain_preview.rb +240 -0
  96. data/lib/mailslurp_client/models/email.rb +86 -78
  97. data/lib/mailslurp_client/models/email_analysis.rb +46 -48
  98. data/lib/mailslurp_client/models/email_preview.rb +77 -41
  99. data/lib/mailslurp_client/models/email_projection.rb +306 -0
  100. data/lib/mailslurp_client/models/forward_email_options.rb +40 -17
  101. data/lib/mailslurp_client/models/group_contacts_dto.rb +227 -0
  102. data/lib/mailslurp_client/models/{webhook.rb → group_dto.rb} +60 -54
  103. data/lib/mailslurp_client/models/group_projection.rb +248 -0
  104. data/lib/mailslurp_client/models/html_validation_result.rb +243 -0
  105. data/lib/mailslurp_client/models/inbox.rb +104 -26
  106. data/lib/mailslurp_client/models/inbox_projection.rb +272 -0
  107. data/lib/mailslurp_client/models/json_node.rb +429 -0
  108. data/lib/mailslurp_client/models/match_option.rb +48 -24
  109. data/lib/mailslurp_client/models/match_options.rb +37 -14
  110. data/lib/mailslurp_client/models/page_contact_projection.rb +298 -0
  111. data/lib/mailslurp_client/models/page_email_preview.rb +298 -0
  112. data/lib/mailslurp_client/models/page_email_projection.rb +298 -0
  113. data/lib/mailslurp_client/models/page_group_projection.rb +298 -0
  114. data/lib/mailslurp_client/models/page_inbox_projection.rb +298 -0
  115. data/lib/mailslurp_client/models/page_template_projection.rb +298 -0
  116. data/lib/mailslurp_client/models/page_webhook_projection.rb +298 -0
  117. data/lib/mailslurp_client/models/pageable.rb +251 -0
  118. data/lib/mailslurp_client/models/raw_email_json.rb +211 -0
  119. data/lib/mailslurp_client/models/send_email_options.rb +141 -46
  120. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +208 -0
  121. data/lib/mailslurp_client/models/sort.rb +224 -0
  122. data/lib/mailslurp_client/models/template_dto.rb +269 -0
  123. data/lib/mailslurp_client/models/template_projection.rb +269 -0
  124. data/lib/mailslurp_client/models/template_variable.rb +259 -0
  125. data/lib/mailslurp_client/models/unread_count.rb +211 -0
  126. data/lib/mailslurp_client/models/update_group_contacts.rb +213 -0
  127. data/lib/mailslurp_client/models/update_inbox_options.rb +250 -0
  128. data/lib/mailslurp_client/models/upload_attachment_options.rb +43 -20
  129. data/lib/mailslurp_client/models/validation_dto.rb +225 -0
  130. data/lib/mailslurp_client/models/validation_message.rb +220 -0
  131. data/lib/mailslurp_client/models/wait_for_conditions.rb +315 -0
  132. data/lib/mailslurp_client/models/webhook_dto.rb +326 -0
  133. data/lib/mailslurp_client/models/webhook_projection.rb +277 -0
  134. data/lib/mailslurp_client/models/webhook_test_request.rb +284 -0
  135. data/lib/mailslurp_client/models/webhook_test_response.rb +215 -0
  136. data/lib/mailslurp_client/models/webhook_test_result.rb +235 -0
  137. data/lib/mailslurp_client/version.rb +5 -5
  138. data/mailslurp_client.gemspec +4 -10
  139. data/spec/api/attachment_controller_api_spec.rb +61 -0
  140. data/spec/api/bulk_actions_controller_api_spec.rb +68 -0
  141. data/spec/api/common_actions_controller_api_spec.rb +129 -0
  142. data/spec/api/contact_controller_api_spec.rb +91 -0
  143. data/spec/api/domain_controller_api_spec.rb +82 -0
  144. data/spec/api/email_controller_api_spec.rb +162 -0
  145. data/spec/api/group_controller_api_spec.rb +126 -0
  146. data/spec/api/inbox_controller_api_spec.rb +172 -0
  147. data/spec/api/template_controller_api_spec.rb +91 -0
  148. data/spec/api/wait_for_controller_api_spec.rb +107 -0
  149. data/spec/api/webhook_controller_api_spec.rb +107 -0
  150. data/spec/api_client_spec.rb +5 -5
  151. data/spec/configuration_spec.rb +4 -4
  152. data/spec/models/attachment_meta_data_spec.rb +59 -0
  153. data/spec/models/basic_auth_options_spec.rb +4 -4
  154. data/spec/models/bulk_send_email_options_spec.rb +4 -4
  155. data/spec/models/contact_dto_spec.rb +83 -0
  156. data/spec/models/contact_projection_spec.rb +71 -0
  157. data/spec/models/create_contact_options_spec.rb +83 -0
  158. data/spec/models/create_domain_options_spec.rb +41 -0
  159. data/spec/models/create_group_options_spec.rb +47 -0
  160. data/spec/models/create_template_options_spec.rb +47 -0
  161. data/spec/models/create_webhook_options_spec.rb +6 -6
  162. data/spec/models/domain_dto_spec.rb +77 -0
  163. data/spec/models/domain_preview_spec.rb +53 -0
  164. data/spec/models/email_analysis_spec.rb +4 -4
  165. data/spec/models/email_preview_spec.rb +41 -5
  166. data/spec/models/email_projection_spec.rb +89 -0
  167. data/spec/models/email_spec.rb +17 -5
  168. data/spec/models/forward_email_options_spec.rb +4 -4
  169. data/spec/models/group_contacts_dto_spec.rb +47 -0
  170. data/spec/models/group_dto_spec.rb +59 -0
  171. data/spec/models/group_projection_spec.rb +59 -0
  172. data/spec/models/html_validation_result_spec.rb +53 -0
  173. data/spec/models/inbox_projection_spec.rb +77 -0
  174. data/spec/models/inbox_spec.rb +35 -5
  175. data/spec/models/json_node_spec.rb +171 -0
  176. data/spec/models/match_option_spec.rb +4 -4
  177. data/spec/models/match_options_spec.rb +4 -4
  178. data/spec/models/page_contact_projection_spec.rb +101 -0
  179. data/spec/models/page_email_preview_spec.rb +101 -0
  180. data/spec/models/page_email_projection_spec.rb +101 -0
  181. data/spec/models/page_group_projection_spec.rb +101 -0
  182. data/spec/models/page_inbox_projection_spec.rb +101 -0
  183. data/spec/models/page_template_projection_spec.rb +101 -0
  184. data/spec/models/page_webhook_projection_spec.rb +101 -0
  185. data/spec/models/pageable_spec.rb +71 -0
  186. data/spec/models/raw_email_json_spec.rb +41 -0
  187. data/spec/models/send_email_options_spec.rb +45 -5
  188. data/spec/models/set_inbox_favourited_options_spec.rb +41 -0
  189. data/spec/models/sort_spec.rb +53 -0
  190. data/spec/models/template_dto_spec.rb +65 -0
  191. data/spec/models/template_projection_spec.rb +65 -0
  192. data/spec/models/template_variable_spec.rb +51 -0
  193. data/spec/models/unread_count_spec.rb +41 -0
  194. data/spec/models/update_group_contacts_spec.rb +41 -0
  195. data/spec/models/{webhook_spec.rb → update_inbox_options_spec.rb} +14 -20
  196. data/spec/models/upload_attachment_options_spec.rb +4 -4
  197. data/spec/models/validation_dto_spec.rb +47 -0
  198. data/spec/models/validation_message_spec.rb +47 -0
  199. data/spec/models/wait_for_conditions_spec.rb +85 -0
  200. data/spec/models/webhook_dto_spec.rb +93 -0
  201. data/spec/models/webhook_projection_spec.rb +71 -0
  202. data/spec/models/webhook_test_request_spec.rb +63 -0
  203. data/spec/models/webhook_test_response_spec.rb +47 -0
  204. data/spec/models/webhook_test_result_spec.rb +53 -0
  205. data/spec/spec_helper.rb +4 -4
  206. metadata +223 -149
  207. data/Gemfile.lock +0 -79
  208. data/docs/CommonOperationsApi.md +0 -499
  209. data/docs/ExtraOperationsApi.md +0 -1021
  210. data/docs/Webhook.md +0 -13
  211. data/lib/mailslurp_client/api/common_operations_api.rb +0 -502
  212. data/lib/mailslurp_client/api/extra_operations_api.rb +0 -1054
  213. data/spec/api/common_operations_api_spec.rb +0 -95
  214. data/spec/api/extra_operations_api_spec.rb +0 -231
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #MailSlurp API
3
3
 
4
- #For documentation see [developer guide](https://www.mailslurp.com/developers). [Create an account](https://app.mailslurp.com) in the MailSlurp Dashboard to [view your API Key](https://app). For all bugs, feature requests, or help please [see support](https://www.mailslurp.com/support/).
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
5
7
 
6
- OpenAPI spec version: 0.0.1-alpha
7
- Contact: contact@mailslurp.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.4
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -43,31 +43,44 @@ module MailSlurpClient
43
43
  }
44
44
  end
45
45
 
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
46
52
  # Initializes the object
47
53
  # @param [Hash] attributes Model attributes in the form of hash
48
54
  def initialize(attributes = {})
49
- return unless attributes.is_a?(Hash)
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ForwardEmailOptions` initialize method"
57
+ end
50
58
 
51
- # convert string to symbol for hash key
52
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ForwardEmailOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
53
66
 
54
- if attributes.has_key?(:'to')
67
+ if attributes.key?(:'to')
55
68
  if (value = attributes[:'to']).is_a?(Array)
56
69
  self.to = value
57
70
  end
58
71
  end
59
72
 
60
- if attributes.has_key?(:'subject')
73
+ if attributes.key?(:'subject')
61
74
  self.subject = attributes[:'subject']
62
75
  end
63
76
 
64
- if attributes.has_key?(:'cc')
77
+ if attributes.key?(:'cc')
65
78
  if (value = attributes[:'cc']).is_a?(Array)
66
79
  self.cc = value
67
80
  end
68
81
  end
69
82
 
70
- if attributes.has_key?(:'bcc')
83
+ if attributes.key?(:'bcc')
71
84
  if (value = attributes[:'bcc']).is_a?(Array)
72
85
  self.bcc = value
73
86
  end
@@ -110,11 +123,18 @@ module MailSlurpClient
110
123
  end
111
124
 
112
125
  # Calculates hash code according to all attributes.
113
- # @return [Fixnum] Hash code
126
+ # @return [Integer] Hash code
114
127
  def hash
115
128
  [to, subject, cc, bcc].hash
116
129
  end
117
130
 
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ new.build_from_hash(attributes)
136
+ end
137
+
118
138
  # Builds the object from hash
119
139
  # @param [Hash] attributes Model attributes in the form of hash
120
140
  # @return [Object] Returns the model itself
@@ -122,7 +142,7 @@ module MailSlurpClient
122
142
  return nil unless attributes.is_a?(Hash)
123
143
  self.class.openapi_types.each_pair do |key, type|
124
144
  if type =~ /\AArray<(.*)>/i
125
- # check to ensure the input is an array given that the the attribute
145
+ # check to ensure the input is an array given that the attribute
126
146
  # is documented as an array but the input is not
127
147
  if attributes[self.class.attribute_map[key]].is_a?(Array)
128
148
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -151,7 +171,7 @@ module MailSlurpClient
151
171
  value.to_i
152
172
  when :Float
153
173
  value.to_f
154
- when :BOOLEAN
174
+ when :Boolean
155
175
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
176
  true
157
177
  else
@@ -172,8 +192,7 @@ module MailSlurpClient
172
192
  end
173
193
  end
174
194
  else # model
175
- temp_model = MailSlurpClient.const_get(type).new
176
- temp_model.build_from_hash(value)
195
+ MailSlurpClient.const_get(type).build_from_hash(value)
177
196
  end
178
197
  end
179
198
 
@@ -195,7 +214,11 @@ module MailSlurpClient
195
214
  hash = {}
196
215
  self.class.attribute_map.each_pair do |attr, param|
197
216
  value = self.send(attr)
198
- next if value.nil?
217
+ if value.nil?
218
+ is_nullable = self.class.openapi_nullable.include?(attr)
219
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
+ end
221
+
199
222
  hash[param] = _to_hash(value)
200
223
  end
201
224
  hash
@@ -0,0 +1,227 @@
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 GroupContactsDto
17
+ attr_accessor :contacts
18
+
19
+ attr_accessor :group
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'contacts' => :'contacts',
25
+ :'group' => :'group'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'contacts' => :'Array<ContactDto>',
33
+ :'group' => :'GroupDto'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::GroupContactsDto` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::GroupContactsDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'contacts')
59
+ if (value = attributes[:'contacts']).is_a?(Array)
60
+ self.contacts = value
61
+ end
62
+ end
63
+
64
+ if attributes.key?(:'group')
65
+ self.group = attributes[:'group']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @contacts.nil?
74
+ invalid_properties.push('invalid value for "contacts", contacts cannot be nil.')
75
+ end
76
+
77
+ if @group.nil?
78
+ invalid_properties.push('invalid value for "group", group cannot be nil.')
79
+ end
80
+
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @contacts.nil?
88
+ return false if @group.nil?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ contacts == o.contacts &&
98
+ group == o.group
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [contacts, group].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.openapi_types.each_pair do |key, type|
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ MailSlurpClient.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end
@@ -1,90 +1,83 @@
1
1
  =begin
2
2
  #MailSlurp API
3
3
 
4
- #For documentation see [developer guide](https://www.mailslurp.com/developers). [Create an account](https://app.mailslurp.com) in the MailSlurp Dashboard to [view your API Key](https://app). For all bugs, feature requests, or help please [see support](https://www.mailslurp.com/support/).
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
5
7
 
6
- OpenAPI spec version: 0.0.1-alpha
7
- Contact: contact@mailslurp.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.4
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Representation of a webhook for an inbox.
17
- class Webhook
18
- # Does Webhook expect basic authentication
19
- attr_accessor :basic_auth
20
-
16
+ class GroupDto
21
17
  attr_accessor :created_at
22
18
 
23
- # ID of the Webhook
24
- attr_accessor :id
19
+ attr_accessor :description
25
20
 
26
- # The inbox that the Webhook will be triggered by
27
- attr_accessor :inbox_id
21
+ attr_accessor :id
28
22
 
29
23
  attr_accessor :name
30
24
 
31
- attr_accessor :updated_at
32
-
33
25
  # Attribute mapping from ruby-style variable name to JSON key.
34
26
  def self.attribute_map
35
27
  {
36
- :'basic_auth' => :'basicAuth',
37
28
  :'created_at' => :'createdAt',
29
+ :'description' => :'description',
38
30
  :'id' => :'id',
39
- :'inbox_id' => :'inboxId',
40
- :'name' => :'name',
41
- :'updated_at' => :'updatedAt'
31
+ :'name' => :'name'
42
32
  }
43
33
  end
44
34
 
45
35
  # Attribute type mapping.
46
36
  def self.openapi_types
47
37
  {
48
- :'basic_auth' => :'BOOLEAN',
49
38
  :'created_at' => :'DateTime',
39
+ :'description' => :'String',
50
40
  :'id' => :'String',
51
- :'inbox_id' => :'String',
52
- :'name' => :'String',
53
- :'updated_at' => :'DateTime'
41
+ :'name' => :'String'
54
42
  }
55
43
  end
56
44
 
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
57
51
  # Initializes the object
58
52
  # @param [Hash] attributes Model attributes in the form of hash
59
53
  def initialize(attributes = {})
60
- return unless attributes.is_a?(Hash)
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::GroupDto` initialize method"
56
+ end
61
57
 
62
- # convert string to symbol for hash key
63
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::GroupDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
64
65
 
65
- if attributes.has_key?(:'basicAuth')
66
- self.basic_auth = attributes[:'basicAuth']
66
+ if attributes.key?(:'created_at')
67
+ self.created_at = attributes[:'created_at']
67
68
  end
68
69
 
69
- if attributes.has_key?(:'createdAt')
70
- self.created_at = attributes[:'createdAt']
70
+ if attributes.key?(:'description')
71
+ self.description = attributes[:'description']
71
72
  end
72
73
 
73
- if attributes.has_key?(:'id')
74
+ if attributes.key?(:'id')
74
75
  self.id = attributes[:'id']
75
76
  end
76
77
 
77
- if attributes.has_key?(:'inboxId')
78
- self.inbox_id = attributes[:'inboxId']
79
- end
80
-
81
- if attributes.has_key?(:'name')
78
+ if attributes.key?(:'name')
82
79
  self.name = attributes[:'name']
83
80
  end
84
-
85
- if attributes.has_key?(:'updatedAt')
86
- self.updated_at = attributes[:'updatedAt']
87
- end
88
81
  end
89
82
 
90
83
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -95,8 +88,12 @@ module MailSlurpClient
95
88
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
96
89
  end
97
90
 
98
- if @updated_at.nil?
99
- invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
91
+ if @id.nil?
92
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
93
+ end
94
+
95
+ if @name.nil?
96
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
100
97
  end
101
98
 
102
99
  invalid_properties
@@ -106,7 +103,8 @@ module MailSlurpClient
106
103
  # @return true if the model is valid
107
104
  def valid?
108
105
  return false if @created_at.nil?
109
- return false if @updated_at.nil?
106
+ return false if @id.nil?
107
+ return false if @name.nil?
110
108
  true
111
109
  end
112
110
 
@@ -115,12 +113,10 @@ module MailSlurpClient
115
113
  def ==(o)
116
114
  return true if self.equal?(o)
117
115
  self.class == o.class &&
118
- basic_auth == o.basic_auth &&
119
116
  created_at == o.created_at &&
117
+ description == o.description &&
120
118
  id == o.id &&
121
- inbox_id == o.inbox_id &&
122
- name == o.name &&
123
- updated_at == o.updated_at
119
+ name == o.name
124
120
  end
125
121
 
126
122
  # @see the `==` method
@@ -130,9 +126,16 @@ module MailSlurpClient
130
126
  end
131
127
 
132
128
  # Calculates hash code according to all attributes.
133
- # @return [Fixnum] Hash code
129
+ # @return [Integer] Hash code
134
130
  def hash
135
- [basic_auth, created_at, id, inbox_id, name, updated_at].hash
131
+ [created_at, description, id, name].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
136
139
  end
137
140
 
138
141
  # Builds the object from hash
@@ -142,7 +145,7 @@ module MailSlurpClient
142
145
  return nil unless attributes.is_a?(Hash)
143
146
  self.class.openapi_types.each_pair do |key, type|
144
147
  if type =~ /\AArray<(.*)>/i
145
- # check to ensure the input is an array given that the the attribute
148
+ # check to ensure the input is an array given that the attribute
146
149
  # is documented as an array but the input is not
147
150
  if attributes[self.class.attribute_map[key]].is_a?(Array)
148
151
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -171,7 +174,7 @@ module MailSlurpClient
171
174
  value.to_i
172
175
  when :Float
173
176
  value.to_f
174
- when :BOOLEAN
177
+ when :Boolean
175
178
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
179
  true
177
180
  else
@@ -192,8 +195,7 @@ module MailSlurpClient
192
195
  end
193
196
  end
194
197
  else # model
195
- temp_model = MailSlurpClient.const_get(type).new
196
- temp_model.build_from_hash(value)
198
+ MailSlurpClient.const_get(type).build_from_hash(value)
197
199
  end
198
200
  end
199
201
 
@@ -215,7 +217,11 @@ module MailSlurpClient
215
217
  hash = {}
216
218
  self.class.attribute_map.each_pair do |attr, param|
217
219
  value = self.send(attr)
218
- next if value.nil?
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
219
225
  hash[param] = _to_hash(value)
220
226
  end
221
227
  hash