mailslurp_client 15.7.8 → 15.7.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/alias_controller_api.rb +1 -1
  3. data/lib/mailslurp_client/api/attachment_controller_api.rb +1 -1
  4. data/lib/mailslurp_client/api/bounce_controller_api.rb +1 -1
  5. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +1 -1
  6. data/lib/mailslurp_client/api/common_actions_controller_api.rb +1 -1
  7. data/lib/mailslurp_client/api/contact_controller_api.rb +1 -1
  8. data/lib/mailslurp_client/api/domain_controller_api.rb +1 -1
  9. data/lib/mailslurp_client/api/email_controller_api.rb +1 -1
  10. data/lib/mailslurp_client/api/email_verification_controller_api.rb +1 -1
  11. data/lib/mailslurp_client/api/expired_controller_api.rb +1 -1
  12. data/lib/mailslurp_client/api/export_controller_api.rb +1 -1
  13. data/lib/mailslurp_client/api/form_controller_api.rb +1 -1
  14. data/lib/mailslurp_client/api/group_controller_api.rb +1 -1
  15. data/lib/mailslurp_client/api/inbox_controller_api.rb +61 -1
  16. data/lib/mailslurp_client/api/inbox_forwarder_controller_api.rb +1 -1
  17. data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +1 -1
  18. data/lib/mailslurp_client/api/mail_server_controller_api.rb +1 -1
  19. data/lib/mailslurp_client/api/missed_email_controller_api.rb +1 -1
  20. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +1 -1
  21. data/lib/mailslurp_client/api/template_controller_api.rb +1 -1
  22. data/lib/mailslurp_client/api/tracking_controller_api.rb +1 -1
  23. data/lib/mailslurp_client/api/wait_for_controller_api.rb +1 -1
  24. data/lib/mailslurp_client/api/webhook_controller_api.rb +300 -4
  25. data/lib/mailslurp_client/api_client.rb +1 -1
  26. data/lib/mailslurp_client/api_error.rb +1 -1
  27. data/lib/mailslurp_client/configuration.rb +1 -1
  28. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +3 -3
  29. data/lib/mailslurp_client/models/alias_dto.rb +1 -1
  30. data/lib/mailslurp_client/models/alias_projection.rb +1 -1
  31. data/lib/mailslurp_client/models/attachment_entity.rb +1 -1
  32. data/lib/mailslurp_client/models/attachment_meta_data.rb +1 -1
  33. data/lib/mailslurp_client/models/attachment_projection.rb +1 -1
  34. data/lib/mailslurp_client/models/basic_auth_options.rb +1 -1
  35. data/lib/mailslurp_client/models/bounce_projection.rb +1 -1
  36. data/lib/mailslurp_client/models/bounce_recipient.rb +6 -1
  37. data/lib/mailslurp_client/models/bounced_email_dto.rb +1 -1
  38. data/lib/mailslurp_client/models/bounced_recipient_dto.rb +1 -1
  39. data/lib/mailslurp_client/models/bulk_send_email_options.rb +1 -1
  40. data/lib/mailslurp_client/models/condition_option.rb +1 -1
  41. data/lib/mailslurp_client/models/contact_dto.rb +1 -1
  42. data/lib/mailslurp_client/models/contact_projection.rb +1 -1
  43. data/lib/mailslurp_client/models/content_match_options.rb +1 -1
  44. data/lib/mailslurp_client/models/count_dto.rb +1 -1
  45. data/lib/mailslurp_client/models/create_alias_options.rb +1 -1
  46. data/lib/mailslurp_client/models/create_contact_options.rb +1 -1
  47. data/lib/mailslurp_client/models/create_domain_options.rb +1 -1
  48. data/lib/mailslurp_client/models/create_group_options.rb +1 -1
  49. data/lib/mailslurp_client/models/create_inbox_dto.rb +1 -1
  50. data/lib/mailslurp_client/models/create_inbox_forwarder_options.rb +1 -1
  51. data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +1 -1
  52. data/lib/mailslurp_client/models/create_template_options.rb +1 -1
  53. data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +1 -1
  54. data/lib/mailslurp_client/models/create_webhook_options.rb +3 -3
  55. data/lib/mailslurp_client/models/describe_domain_options.rb +1 -1
  56. data/lib/mailslurp_client/models/describe_mail_server_domain_result.rb +1 -1
  57. data/lib/mailslurp_client/models/dns_lookup_options.rb +1 -1
  58. data/lib/mailslurp_client/models/dns_lookup_result.rb +1 -1
  59. data/lib/mailslurp_client/models/dns_lookup_results.rb +1 -1
  60. data/lib/mailslurp_client/models/domain_dto.rb +1 -1
  61. data/lib/mailslurp_client/models/domain_name_record.rb +1 -1
  62. data/lib/mailslurp_client/models/domain_preview.rb +1 -1
  63. data/lib/mailslurp_client/models/download_attachment_dto.rb +1 -1
  64. data/lib/mailslurp_client/models/email.rb +1 -1
  65. data/lib/mailslurp_client/models/email_analysis.rb +1 -1
  66. data/lib/mailslurp_client/models/email_content_match_result.rb +1 -1
  67. data/lib/mailslurp_client/models/email_links_result.rb +1 -1
  68. data/lib/mailslurp_client/models/email_preview.rb +1 -1
  69. data/lib/mailslurp_client/models/email_preview_urls.rb +1 -1
  70. data/lib/mailslurp_client/models/email_projection.rb +14 -14
  71. data/lib/mailslurp_client/models/email_recipients.rb +1 -1
  72. data/lib/mailslurp_client/models/email_text_lines_result.rb +1 -1
  73. data/lib/mailslurp_client/models/email_validation_request.rb +1 -1
  74. data/lib/mailslurp_client/models/email_verification_result.rb +1 -1
  75. data/lib/mailslurp_client/models/expiration_defaults.rb +1 -1
  76. data/lib/mailslurp_client/models/expired_inbox_dto.rb +1 -1
  77. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +1 -1
  78. data/lib/mailslurp_client/models/export_link.rb +1 -1
  79. data/lib/mailslurp_client/models/export_options.rb +1 -1
  80. data/lib/mailslurp_client/models/filter_bounced_recipients_options.rb +1 -1
  81. data/lib/mailslurp_client/models/filter_bounced_recipients_result.rb +1 -1
  82. data/lib/mailslurp_client/models/flush_expired_inboxes_result.rb +1 -1
  83. data/lib/mailslurp_client/models/forward_email_options.rb +1 -1
  84. data/lib/mailslurp_client/models/gravatar_url.rb +1 -1
  85. data/lib/mailslurp_client/models/group_contacts_dto.rb +1 -1
  86. data/lib/mailslurp_client/models/group_dto.rb +1 -1
  87. data/lib/mailslurp_client/models/group_projection.rb +1 -1
  88. data/lib/mailslurp_client/models/html_validation_result.rb +1 -1
  89. data/lib/mailslurp_client/models/imap_flag_operation_options.rb +1 -1
  90. data/lib/mailslurp_client/models/imap_smtp_access_details.rb +1 -1
  91. data/lib/mailslurp_client/models/inbox_by_email_address_result.rb +1 -1
  92. data/lib/mailslurp_client/models/inbox_dto.rb +2 -2
  93. data/lib/mailslurp_client/models/inbox_exists_dto.rb +1 -1
  94. data/lib/mailslurp_client/models/inbox_forwarder_dto.rb +1 -1
  95. data/lib/mailslurp_client/models/inbox_forwarder_test_options.rb +1 -1
  96. data/lib/mailslurp_client/models/inbox_forwarder_test_result.rb +1 -1
  97. data/lib/mailslurp_client/models/inbox_id_item.rb +1 -1
  98. data/lib/mailslurp_client/models/inbox_ids_result.rb +1 -1
  99. data/lib/mailslurp_client/models/inbox_preview.rb +1 -1
  100. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +1 -1
  101. data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +1 -1
  102. data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +1 -1
  103. data/lib/mailslurp_client/models/inline_object.rb +1 -1
  104. data/lib/mailslurp_client/models/ip_address_result.rb +1 -1
  105. data/lib/mailslurp_client/models/json_schema_dto.rb +1 -1
  106. data/lib/mailslurp_client/models/match_option.rb +1 -1
  107. data/lib/mailslurp_client/models/match_options.rb +1 -1
  108. data/lib/mailslurp_client/models/missed_email.rb +1 -1
  109. data/lib/mailslurp_client/models/missed_email_projection.rb +1 -1
  110. data/lib/mailslurp_client/models/name_server_record.rb +1 -1
  111. data/lib/mailslurp_client/models/organization_inbox_projection.rb +1 -1
  112. data/lib/mailslurp_client/models/page_alias.rb +1 -1
  113. data/lib/mailslurp_client/models/page_attachment_entity.rb +1 -1
  114. data/lib/mailslurp_client/models/page_bounced_email.rb +1 -1
  115. data/lib/mailslurp_client/models/page_bounced_recipients.rb +1 -1
  116. data/lib/mailslurp_client/models/page_contact_projection.rb +1 -1
  117. data/lib/mailslurp_client/models/page_email_preview.rb +1 -1
  118. data/lib/mailslurp_client/models/page_email_projection.rb +1 -1
  119. data/lib/mailslurp_client/models/page_email_validation_request.rb +1 -1
  120. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +1 -1
  121. data/lib/mailslurp_client/models/page_group_projection.rb +1 -1
  122. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +1 -1
  123. data/lib/mailslurp_client/models/page_inbox_projection.rb +1 -1
  124. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +1 -1
  125. data/lib/mailslurp_client/models/page_missed_email_projection.rb +1 -1
  126. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +1 -1
  127. data/lib/mailslurp_client/models/page_sent_email_projection.rb +1 -1
  128. data/lib/mailslurp_client/models/page_template_projection.rb +1 -1
  129. data/lib/mailslurp_client/models/page_thread_projection.rb +1 -1
  130. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +1 -1
  131. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +1 -1
  132. data/lib/mailslurp_client/models/page_webhook_projection.rb +1 -1
  133. data/lib/mailslurp_client/models/page_webhook_result.rb +1 -1
  134. data/lib/mailslurp_client/models/pageable_object.rb +1 -1
  135. data/lib/mailslurp_client/models/raw_email_json.rb +1 -1
  136. data/lib/mailslurp_client/models/recipient.rb +1 -1
  137. data/lib/mailslurp_client/models/reply_to_alias_email_options.rb +1 -1
  138. data/lib/mailslurp_client/models/reply_to_email_options.rb +1 -1
  139. data/lib/mailslurp_client/models/send_email_options.rb +1 -1
  140. data/lib/mailslurp_client/models/send_smtp_envelope_options.rb +1 -1
  141. data/lib/mailslurp_client/models/sender.rb +1 -1
  142. data/lib/mailslurp_client/models/sent_email_dto.rb +1 -1
  143. data/lib/mailslurp_client/models/sent_email_projection.rb +16 -16
  144. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +1 -1
  145. data/lib/mailslurp_client/models/simple_send_email_options.rb +1 -1
  146. data/lib/mailslurp_client/models/sort.rb +1 -1
  147. data/lib/mailslurp_client/models/template_dto.rb +1 -1
  148. data/lib/mailslurp_client/models/template_projection.rb +1 -1
  149. data/lib/mailslurp_client/models/template_variable.rb +1 -1
  150. data/lib/mailslurp_client/models/test_new_inbox_forwarder_options.rb +1 -1
  151. data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +1 -1
  152. data/lib/mailslurp_client/models/thread_projection.rb +1 -1
  153. data/lib/mailslurp_client/models/tracking_pixel_dto.rb +1 -1
  154. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +1 -1
  155. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +1 -1
  156. data/lib/mailslurp_client/models/unread_count.rb +1 -1
  157. data/lib/mailslurp_client/models/unseen_error_count_dto.rb +1 -1
  158. data/lib/mailslurp_client/models/update_alias_options.rb +1 -1
  159. data/lib/mailslurp_client/models/update_domain_options.rb +1 -1
  160. data/lib/mailslurp_client/models/update_group_contacts.rb +1 -1
  161. data/lib/mailslurp_client/models/update_inbox_options.rb +1 -1
  162. data/lib/mailslurp_client/models/upload_attachment_options.rb +1 -1
  163. data/lib/mailslurp_client/models/validate_email_address_list_options.rb +1 -1
  164. data/lib/mailslurp_client/models/validate_email_address_list_result.rb +1 -1
  165. data/lib/mailslurp_client/models/validation_dto.rb +1 -1
  166. data/lib/mailslurp_client/models/validation_message.rb +1 -1
  167. data/lib/mailslurp_client/models/verify_email_address_options.rb +1 -1
  168. data/lib/mailslurp_client/models/wait_for_conditions.rb +1 -1
  169. data/lib/mailslurp_client/models/webhook_bounce_payload.rb +339 -0
  170. data/lib/mailslurp_client/models/{get_or_create_saml_user_options.rb → webhook_bounce_recipient_payload.rb} +97 -29
  171. data/lib/mailslurp_client/models/webhook_dto.rb +4 -9
  172. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +3 -3
  173. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +3 -3
  174. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +3 -3
  175. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +3 -3
  176. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +3 -3
  177. data/lib/mailslurp_client/models/webhook_projection.rb +3 -8
  178. data/lib/mailslurp_client/models/webhook_redrive_result.rb +1 -1
  179. data/lib/mailslurp_client/models/webhook_result_dto.rb +3 -8
  180. data/lib/mailslurp_client/models/webhook_test_request.rb +1 -1
  181. data/lib/mailslurp_client/models/webhook_test_response.rb +1 -1
  182. data/lib/mailslurp_client/models/webhook_test_result.rb +1 -1
  183. data/lib/mailslurp_client/version.rb +2 -2
  184. data/lib/mailslurp_client.rb +3 -4
  185. metadata +4 -5
  186. data/lib/mailslurp_client/api/api_internal_controller_api.rb +0 -89
  187. data/lib/mailslurp_client/models/user_dto.rb +0 -438
@@ -1,438 +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: 6.5.2
7
- Contact: contact@mailslurp.dev
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module MailSlurpClient
16
- # Representation a user's account
17
- class UserDto
18
- attr_accessor :id
19
-
20
- attr_accessor :api_key
21
-
22
- attr_accessor :email_address
23
-
24
- attr_accessor :email_address_md5
25
-
26
- attr_accessor :created
27
-
28
- attr_accessor :user_type
29
-
30
- # Does user belong to an organization
31
- attr_accessor :organization
32
-
33
- # Has user accepted an organization invite
34
- attr_accessor :verified
35
-
36
- attr_accessor :has_password
37
-
38
- attr_accessor :is_frozen
39
-
40
- attr_accessor :add_new_contacts
41
-
42
- attr_accessor :sso_provider
43
-
44
- attr_accessor :customer_id
45
-
46
- attr_accessor :has_onboarded
47
-
48
- attr_accessor :imap_username
49
-
50
- attr_accessor :imap_password
51
-
52
- attr_accessor :smtp_username
53
-
54
- attr_accessor :smtp_password
55
-
56
- class EnumAttributeValidator
57
- attr_reader :datatype
58
- attr_reader :allowable_values
59
-
60
- def initialize(datatype, allowable_values)
61
- @allowable_values = allowable_values.map do |value|
62
- case datatype.to_s
63
- when /Integer/i
64
- value.to_i
65
- when /Float/i
66
- value.to_f
67
- else
68
- value
69
- end
70
- end
71
- end
72
-
73
- def valid?(value)
74
- !value || allowable_values.include?(value)
75
- end
76
- end
77
-
78
- # Attribute mapping from ruby-style variable name to JSON key.
79
- def self.attribute_map
80
- {
81
- :'id' => :'id',
82
- :'api_key' => :'apiKey',
83
- :'email_address' => :'emailAddress',
84
- :'email_address_md5' => :'emailAddressMd5',
85
- :'created' => :'created',
86
- :'user_type' => :'userType',
87
- :'organization' => :'organization',
88
- :'verified' => :'verified',
89
- :'has_password' => :'hasPassword',
90
- :'is_frozen' => :'isFrozen',
91
- :'add_new_contacts' => :'addNewContacts',
92
- :'sso_provider' => :'ssoProvider',
93
- :'customer_id' => :'customerId',
94
- :'has_onboarded' => :'hasOnboarded',
95
- :'imap_username' => :'imapUsername',
96
- :'imap_password' => :'imapPassword',
97
- :'smtp_username' => :'smtpUsername',
98
- :'smtp_password' => :'smtpPassword'
99
- }
100
- end
101
-
102
- # Attribute type mapping.
103
- def self.openapi_types
104
- {
105
- :'id' => :'String',
106
- :'api_key' => :'String',
107
- :'email_address' => :'String',
108
- :'email_address_md5' => :'String',
109
- :'created' => :'DateTime',
110
- :'user_type' => :'String',
111
- :'organization' => :'String',
112
- :'verified' => :'String',
113
- :'has_password' => :'Boolean',
114
- :'is_frozen' => :'Boolean',
115
- :'add_new_contacts' => :'Boolean',
116
- :'sso_provider' => :'String',
117
- :'customer_id' => :'String',
118
- :'has_onboarded' => :'Boolean',
119
- :'imap_username' => :'String',
120
- :'imap_password' => :'String',
121
- :'smtp_username' => :'String',
122
- :'smtp_password' => :'String'
123
- }
124
- end
125
-
126
- # List of attributes with nullable: true
127
- def self.openapi_nullable
128
- Set.new([
129
- ])
130
- end
131
-
132
- # Initializes the object
133
- # @param [Hash] attributes Model attributes in the form of hash
134
- def initialize(attributes = {})
135
- if (!attributes.is_a?(Hash))
136
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::UserDto` initialize method"
137
- end
138
-
139
- # check to see if the attribute exists and convert string to symbol for hash key
140
- attributes = attributes.each_with_object({}) { |(k, v), h|
141
- if (!self.class.attribute_map.key?(k.to_sym))
142
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::UserDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
143
- end
144
- h[k.to_sym] = v
145
- }
146
-
147
- if attributes.key?(:'id')
148
- self.id = attributes[:'id']
149
- end
150
-
151
- if attributes.key?(:'api_key')
152
- self.api_key = attributes[:'api_key']
153
- end
154
-
155
- if attributes.key?(:'email_address')
156
- self.email_address = attributes[:'email_address']
157
- end
158
-
159
- if attributes.key?(:'email_address_md5')
160
- self.email_address_md5 = attributes[:'email_address_md5']
161
- end
162
-
163
- if attributes.key?(:'created')
164
- self.created = attributes[:'created']
165
- end
166
-
167
- if attributes.key?(:'user_type')
168
- self.user_type = attributes[:'user_type']
169
- end
170
-
171
- if attributes.key?(:'organization')
172
- self.organization = attributes[:'organization']
173
- end
174
-
175
- if attributes.key?(:'verified')
176
- self.verified = attributes[:'verified']
177
- end
178
-
179
- if attributes.key?(:'has_password')
180
- self.has_password = attributes[:'has_password']
181
- end
182
-
183
- if attributes.key?(:'is_frozen')
184
- self.is_frozen = attributes[:'is_frozen']
185
- end
186
-
187
- if attributes.key?(:'add_new_contacts')
188
- self.add_new_contacts = attributes[:'add_new_contacts']
189
- end
190
-
191
- if attributes.key?(:'sso_provider')
192
- self.sso_provider = attributes[:'sso_provider']
193
- end
194
-
195
- if attributes.key?(:'customer_id')
196
- self.customer_id = attributes[:'customer_id']
197
- end
198
-
199
- if attributes.key?(:'has_onboarded')
200
- self.has_onboarded = attributes[:'has_onboarded']
201
- end
202
-
203
- if attributes.key?(:'imap_username')
204
- self.imap_username = attributes[:'imap_username']
205
- end
206
-
207
- if attributes.key?(:'imap_password')
208
- self.imap_password = attributes[:'imap_password']
209
- end
210
-
211
- if attributes.key?(:'smtp_username')
212
- self.smtp_username = attributes[:'smtp_username']
213
- end
214
-
215
- if attributes.key?(:'smtp_password')
216
- self.smtp_password = attributes[:'smtp_password']
217
- end
218
- end
219
-
220
- # Show invalid properties with the reasons. Usually used together with valid?
221
- # @return Array for valid properties with the reasons
222
- def list_invalid_properties
223
- invalid_properties = Array.new
224
- if @id.nil?
225
- invalid_properties.push('invalid value for "id", id cannot be nil.')
226
- end
227
-
228
- if @api_key.nil?
229
- invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
230
- end
231
-
232
- if @email_address.nil?
233
- invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
234
- end
235
-
236
- if @email_address_md5.nil?
237
- invalid_properties.push('invalid value for "email_address_md5", email_address_md5 cannot be nil.')
238
- end
239
-
240
- if @has_password.nil?
241
- invalid_properties.push('invalid value for "has_password", has_password cannot be nil.')
242
- end
243
-
244
- if @is_frozen.nil?
245
- invalid_properties.push('invalid value for "is_frozen", is_frozen cannot be nil.')
246
- end
247
-
248
- invalid_properties
249
- end
250
-
251
- # Check to see if the all the properties in the model are valid
252
- # @return true if the model is valid
253
- def valid?
254
- return false if @id.nil?
255
- return false if @api_key.nil?
256
- return false if @email_address.nil?
257
- return false if @email_address_md5.nil?
258
- user_type_validator = EnumAttributeValidator.new('String', ["SOLO", "CHILD_SOLO", "CHILD_TEAM"])
259
- return false unless user_type_validator.valid?(@user_type)
260
- verified_validator = EnumAttributeValidator.new('String', ["VERIFIED", "PENDING"])
261
- return false unless verified_validator.valid?(@verified)
262
- return false if @has_password.nil?
263
- return false if @is_frozen.nil?
264
- true
265
- end
266
-
267
- # Custom attribute writer method checking allowed values (enum).
268
- # @param [Object] user_type Object to be assigned
269
- def user_type=(user_type)
270
- validator = EnumAttributeValidator.new('String', ["SOLO", "CHILD_SOLO", "CHILD_TEAM"])
271
- unless validator.valid?(user_type)
272
- fail ArgumentError, "invalid value for \"user_type\", must be one of #{validator.allowable_values}."
273
- end
274
- @user_type = user_type
275
- end
276
-
277
- # Custom attribute writer method checking allowed values (enum).
278
- # @param [Object] verified Object to be assigned
279
- def verified=(verified)
280
- validator = EnumAttributeValidator.new('String', ["VERIFIED", "PENDING"])
281
- unless validator.valid?(verified)
282
- fail ArgumentError, "invalid value for \"verified\", must be one of #{validator.allowable_values}."
283
- end
284
- @verified = verified
285
- end
286
-
287
- # Checks equality by comparing each attribute.
288
- # @param [Object] Object to be compared
289
- def ==(o)
290
- return true if self.equal?(o)
291
- self.class == o.class &&
292
- id == o.id &&
293
- api_key == o.api_key &&
294
- email_address == o.email_address &&
295
- email_address_md5 == o.email_address_md5 &&
296
- created == o.created &&
297
- user_type == o.user_type &&
298
- organization == o.organization &&
299
- verified == o.verified &&
300
- has_password == o.has_password &&
301
- is_frozen == o.is_frozen &&
302
- add_new_contacts == o.add_new_contacts &&
303
- sso_provider == o.sso_provider &&
304
- customer_id == o.customer_id &&
305
- has_onboarded == o.has_onboarded &&
306
- imap_username == o.imap_username &&
307
- imap_password == o.imap_password &&
308
- smtp_username == o.smtp_username &&
309
- smtp_password == o.smtp_password
310
- end
311
-
312
- # @see the `==` method
313
- # @param [Object] Object to be compared
314
- def eql?(o)
315
- self == o
316
- end
317
-
318
- # Calculates hash code according to all attributes.
319
- # @return [Integer] Hash code
320
- def hash
321
- [id, api_key, email_address, email_address_md5, created, user_type, organization, verified, has_password, is_frozen, add_new_contacts, sso_provider, customer_id, has_onboarded, imap_username, imap_password, smtp_username, smtp_password].hash
322
- end
323
-
324
- # Builds the object from hash
325
- # @param [Hash] attributes Model attributes in the form of hash
326
- # @return [Object] Returns the model itself
327
- def self.build_from_hash(attributes)
328
- new.build_from_hash(attributes)
329
- end
330
-
331
- # Builds the object from hash
332
- # @param [Hash] attributes Model attributes in the form of hash
333
- # @return [Object] Returns the model itself
334
- def build_from_hash(attributes)
335
- return nil unless attributes.is_a?(Hash)
336
- self.class.openapi_types.each_pair do |key, type|
337
- if type =~ /\AArray<(.*)>/i
338
- # check to ensure the input is an array given that the attribute
339
- # is documented as an array but the input is not
340
- if attributes[self.class.attribute_map[key]].is_a?(Array)
341
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
342
- end
343
- elsif !attributes[self.class.attribute_map[key]].nil?
344
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
345
- end # or else data not found in attributes(hash), not an issue as the data can be optional
346
- end
347
-
348
- self
349
- end
350
-
351
- # Deserializes the data based on type
352
- # @param string type Data type
353
- # @param string value Value to be deserialized
354
- # @return [Object] Deserialized data
355
- def _deserialize(type, value)
356
- case type.to_sym
357
- when :DateTime
358
- DateTime.parse(value)
359
- when :Date
360
- Date.parse(value)
361
- when :String
362
- value.to_s
363
- when :Integer
364
- value.to_i
365
- when :Float
366
- value.to_f
367
- when :Boolean
368
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
369
- true
370
- else
371
- false
372
- end
373
- when :Object
374
- # generic object (usually a Hash), return directly
375
- value
376
- when /\AArray<(?<inner_type>.+)>\z/
377
- inner_type = Regexp.last_match[:inner_type]
378
- value.map { |v| _deserialize(inner_type, v) }
379
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
380
- k_type = Regexp.last_match[:k_type]
381
- v_type = Regexp.last_match[:v_type]
382
- {}.tap do |hash|
383
- value.each do |k, v|
384
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
385
- end
386
- end
387
- else # model
388
- MailSlurpClient.const_get(type).build_from_hash(value)
389
- end
390
- end
391
-
392
- # Returns the string representation of the object
393
- # @return [String] String presentation of the object
394
- def to_s
395
- to_hash.to_s
396
- end
397
-
398
- # to_body is an alias to to_hash (backward compatibility)
399
- # @return [Hash] Returns the object in the form of hash
400
- def to_body
401
- to_hash
402
- end
403
-
404
- # Returns the object in the form of hash
405
- # @return [Hash] Returns the object in the form of hash
406
- def to_hash
407
- hash = {}
408
- self.class.attribute_map.each_pair do |attr, param|
409
- value = self.send(attr)
410
- if value.nil?
411
- is_nullable = self.class.openapi_nullable.include?(attr)
412
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
413
- end
414
-
415
- hash[param] = _to_hash(value)
416
- end
417
- hash
418
- end
419
-
420
- # Outputs non-array value in the form of hash
421
- # For object, use to_hash. Otherwise, just return the value
422
- # @param [Object] value Any valid value
423
- # @return [Hash] Returns the value in the form of hash
424
- def _to_hash(value)
425
- if value.is_a?(Array)
426
- value.compact.map { |v| _to_hash(v) }
427
- elsif value.is_a?(Hash)
428
- {}.tap do |hash|
429
- value.each { |k, v| hash[k] = _to_hash(v) }
430
- end
431
- elsif value.respond_to? :to_hash
432
- value.to_hash
433
- else
434
- value
435
- end
436
- end
437
- end
438
- end