mailslurp_client 17.2.0 → 17.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/campaign_probe_controller_api.rb +138 -0
  3. data/lib/mailslurp_client/api/domain_monitor_controller_api.rb +264 -0
  4. data/lib/mailslurp_client/api/email_audit_controller_api.rb +334 -0
  5. data/lib/mailslurp_client/api/email_controller_api.rb +124 -0
  6. data/lib/mailslurp_client/api/inbox_controller_api.rb +4 -4
  7. data/lib/mailslurp_client/api/phone_controller_api.rb +1312 -81
  8. data/lib/mailslurp_client/api/sms_controller_api.rb +125 -0
  9. data/lib/mailslurp_client/api/tools_controller_api.rb +806 -0
  10. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +15 -15
  11. data/lib/mailslurp_client/models/acquire_phone_pool_lease_options.rb +233 -0
  12. data/lib/mailslurp_client/models/add_phone_pool_numbers_options.rb +213 -0
  13. data/lib/mailslurp_client/models/ai_transform_mapping_projection.rb +27 -27
  14. data/lib/mailslurp_client/models/ai_transform_projection.rb +28 -28
  15. data/lib/mailslurp_client/models/alias_projection.rb +45 -45
  16. data/lib/mailslurp_client/models/alias_thread_projection.rb +42 -42
  17. data/lib/mailslurp_client/models/analyze_dmarc_report_options.rb +248 -0
  18. data/lib/mailslurp_client/models/analyze_dmarc_report_results.rb +386 -0
  19. data/lib/mailslurp_client/models/analyze_email_headers_options.rb +240 -0
  20. data/lib/mailslurp_client/models/analyze_email_headers_results.rb +275 -0
  21. data/lib/mailslurp_client/models/attachment_projection.rb +50 -50
  22. data/lib/mailslurp_client/models/available_phone_number_dto.rb +325 -0
  23. data/lib/mailslurp_client/models/available_phone_numbers_result.rb +236 -0
  24. data/lib/mailslurp_client/models/bounce_projection.rb +28 -28
  25. data/lib/mailslurp_client/models/bounce_recipient_projection.rb +10 -10
  26. data/lib/mailslurp_client/models/campaign_probe_run_comparison_dto.rb +397 -0
  27. data/lib/mailslurp_client/models/check_campaign_probe_options.rb +371 -0
  28. data/lib/mailslurp_client/models/check_campaign_probe_results.rb +482 -0
  29. data/lib/mailslurp_client/models/check_dns_propagation_options.rb +297 -0
  30. data/lib/mailslurp_client/models/check_dns_propagation_results.rb +361 -0
  31. data/lib/mailslurp_client/models/check_domain_monitor_options.rb +243 -0
  32. data/lib/mailslurp_client/models/check_domain_monitor_results.rb +398 -0
  33. data/lib/mailslurp_client/models/check_email_audit_options.rb +405 -0
  34. data/lib/mailslurp_client/models/check_email_auth_stack_options.rb +248 -0
  35. data/lib/mailslurp_client/models/check_email_auth_stack_results.rb +462 -0
  36. data/lib/mailslurp_client/models/check_email_blacklist_options.rb +241 -0
  37. data/lib/mailslurp_client/models/check_email_blacklist_results.rb +366 -0
  38. data/lib/mailslurp_client/models/connector_event_projection.rb +42 -42
  39. data/lib/mailslurp_client/models/connector_projection.rb +42 -42
  40. data/lib/mailslurp_client/models/contact_projection.rb +15 -15
  41. data/lib/mailslurp_client/models/create_email_audit_options.rb +394 -0
  42. data/lib/mailslurp_client/models/create_phone_number_options.rb +25 -4
  43. data/lib/mailslurp_client/models/create_phone_pool_options.rb +220 -0
  44. data/lib/mailslurp_client/models/create_phone_provisioning_job_item_options.rb +256 -0
  45. data/lib/mailslurp_client/models/create_phone_provisioning_job_options.rb +284 -0
  46. data/lib/mailslurp_client/models/dmarc_report_metadata.rb +308 -0
  47. data/lib/mailslurp_client/models/dmarc_report_source_summary.rb +274 -0
  48. data/lib/mailslurp_client/models/dns_propagation_resolver_result.rb +252 -0
  49. data/lib/mailslurp_client/models/domain_monitor_run_comparison_dto.rb +369 -0
  50. data/lib/mailslurp_client/models/domain_monitor_summary_dto.rb +248 -0
  51. data/lib/mailslurp_client/models/email_audit_analysis_result.rb +620 -0
  52. data/lib/mailslurp_client/models/email_audit_comparison_dto.rb +411 -0
  53. data/lib/mailslurp_client/models/email_audit_dto.rb +308 -0
  54. data/lib/mailslurp_client/models/email_audit_spelling_issue.rb +276 -0
  55. data/lib/mailslurp_client/models/email_audit_url_issue.rb +236 -0
  56. data/lib/mailslurp_client/models/email_blacklist_ip_result.rb +242 -0
  57. data/lib/mailslurp_client/models/email_blacklist_listing_result.rb +258 -0
  58. data/lib/mailslurp_client/models/email_header_analysis_summary.rb +242 -0
  59. data/lib/mailslurp_client/models/email_header_received_hop.rb +242 -0
  60. data/lib/mailslurp_client/models/email_projection.rb +88 -88
  61. data/lib/mailslurp_client/models/email_thread_projection.rb +54 -54
  62. data/lib/mailslurp_client/models/entity_automation_item_projection.rb +33 -33
  63. data/lib/mailslurp_client/models/entity_event_item_projection.rb +42 -42
  64. data/lib/mailslurp_client/models/entity_favourite_item_projection.rb +29 -29
  65. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +27 -27
  66. data/lib/mailslurp_client/models/generate_spf_record_options.rb +357 -0
  67. data/lib/mailslurp_client/models/generate_spf_record_results.rb +318 -0
  68. data/lib/mailslurp_client/models/get_or_create_phone_pool_options.rb +220 -0
  69. data/lib/mailslurp_client/models/group_projection.rb +15 -15
  70. data/lib/mailslurp_client/models/guest_portal_user_projection.rb +47 -47
  71. data/lib/mailslurp_client/models/imap_email_projection.rb +18 -18
  72. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +21 -21
  73. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +33 -33
  74. data/lib/mailslurp_client/models/list_unsubscribe_recipient_projection.rb +19 -19
  75. data/lib/mailslurp_client/models/lookup_dkim_domain_options.rb +275 -0
  76. data/lib/mailslurp_client/models/lookup_dkim_domain_results.rb +304 -0
  77. data/lib/mailslurp_client/models/lookup_ptr_options.rb +241 -0
  78. data/lib/mailslurp_client/models/lookup_ptr_results.rb +305 -0
  79. data/lib/mailslurp_client/models/lookup_spf_domain_options.rb +240 -0
  80. data/lib/mailslurp_client/models/lookup_spf_domain_results.rb +305 -0
  81. data/lib/mailslurp_client/models/missed_email_projection.rb +28 -28
  82. data/lib/mailslurp_client/models/missed_sms_projection.rb +32 -32
  83. data/lib/mailslurp_client/models/opt_in_identity_projection.rb +18 -18
  84. data/lib/mailslurp_client/models/page_ai_transform_mapping_projection.rb +19 -19
  85. data/lib/mailslurp_client/models/page_ai_transform_projection.rb +19 -19
  86. data/lib/mailslurp_client/models/page_ai_transform_result_projection.rb +19 -19
  87. data/lib/mailslurp_client/models/page_alias.rb +19 -19
  88. data/lib/mailslurp_client/models/page_alias_thread_projection.rb +19 -19
  89. data/lib/mailslurp_client/models/page_attachment_entity.rb +19 -19
  90. data/lib/mailslurp_client/models/page_bounced_email.rb +19 -19
  91. data/lib/mailslurp_client/models/page_bounced_recipients.rb +19 -19
  92. data/lib/mailslurp_client/models/page_complaint.rb +19 -19
  93. data/lib/mailslurp_client/models/page_connector.rb +19 -19
  94. data/lib/mailslurp_client/models/page_connector_events.rb +19 -19
  95. data/lib/mailslurp_client/models/page_contact_projection.rb +19 -19
  96. data/lib/mailslurp_client/models/page_delivery_status.rb +19 -19
  97. data/lib/mailslurp_client/models/page_device_preview_run_projection.rb +19 -19
  98. data/lib/mailslurp_client/models/page_email_preview.rb +19 -19
  99. data/lib/mailslurp_client/models/page_email_projection.rb +19 -19
  100. data/lib/mailslurp_client/models/page_email_thread_projection.rb +19 -19
  101. data/lib/mailslurp_client/models/page_email_validation_request.rb +19 -19
  102. data/lib/mailslurp_client/models/page_entity_automation_items.rb +19 -19
  103. data/lib/mailslurp_client/models/page_entity_event_items.rb +19 -19
  104. data/lib/mailslurp_client/models/page_entity_favourite_items.rb +19 -19
  105. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +19 -19
  106. data/lib/mailslurp_client/models/page_group_projection.rb +19 -19
  107. data/lib/mailslurp_client/models/page_guest_portal_users.rb +19 -19
  108. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +19 -19
  109. data/lib/mailslurp_client/models/page_inbox_forwarder_events.rb +19 -19
  110. data/lib/mailslurp_client/models/page_inbox_projection.rb +19 -19
  111. data/lib/mailslurp_client/models/page_inbox_replier_dto.rb +19 -19
  112. data/lib/mailslurp_client/models/page_inbox_replier_events.rb +19 -19
  113. data/lib/mailslurp_client/models/page_inbox_tags.rb +19 -19
  114. data/lib/mailslurp_client/models/page_list_unsubscribe_recipients.rb +19 -19
  115. data/lib/mailslurp_client/models/page_missed_email_projection.rb +19 -19
  116. data/lib/mailslurp_client/models/page_missed_sms_projection.rb +19 -19
  117. data/lib/mailslurp_client/models/page_opt_in_identity_projection.rb +19 -19
  118. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +19 -19
  119. data/lib/mailslurp_client/models/page_phone_message_thread_item_projection.rb +19 -19
  120. data/lib/mailslurp_client/models/page_phone_message_thread_projection.rb +19 -19
  121. data/lib/mailslurp_client/models/page_phone_number_projection.rb +19 -19
  122. data/lib/mailslurp_client/models/page_phone_number_release_projection.rb +19 -19
  123. data/lib/mailslurp_client/models/page_plus_address_projection.rb +19 -19
  124. data/lib/mailslurp_client/models/page_reputation_items.rb +19 -19
  125. data/lib/mailslurp_client/models/page_ruleset_dto.rb +19 -19
  126. data/lib/mailslurp_client/models/page_scheduled_jobs.rb +19 -19
  127. data/lib/mailslurp_client/models/page_sent_email_projection.rb +19 -19
  128. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +19 -19
  129. data/lib/mailslurp_client/models/page_sent_sms_projection.rb +19 -19
  130. data/lib/mailslurp_client/models/page_sms_projection.rb +19 -19
  131. data/lib/mailslurp_client/models/page_template_projection.rb +19 -19
  132. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +19 -19
  133. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +19 -19
  134. data/lib/mailslurp_client/models/page_webhook_endpoint_projection.rb +19 -19
  135. data/lib/mailslurp_client/models/page_webhook_projection.rb +19 -19
  136. data/lib/mailslurp_client/models/page_webhook_result.rb +19 -19
  137. data/lib/mailslurp_client/models/pageable_object.rb +22 -22
  138. data/lib/mailslurp_client/models/phone_message_thread_item_projection.rb +18 -18
  139. data/lib/mailslurp_client/models/phone_number_dto.rb +49 -4
  140. data/lib/mailslurp_client/models/phone_number_line_type_intelligence_dto.rb +242 -0
  141. data/lib/mailslurp_client/models/phone_number_line_type_lookup_dto.rb +286 -0
  142. data/lib/mailslurp_client/models/phone_number_projection.rb +80 -35
  143. data/lib/mailslurp_client/models/phone_number_release_projection.rb +39 -39
  144. data/lib/mailslurp_client/models/phone_pool_detail_dto.rb +334 -0
  145. data/lib/mailslurp_client/models/phone_pool_dto.rb +318 -0
  146. data/lib/mailslurp_client/models/phone_pool_lease_dto.rb +351 -0
  147. data/lib/mailslurp_client/models/phone_pool_member_dto.rb +333 -0
  148. data/lib/mailslurp_client/models/phone_provider_capabilities_result.rb +284 -0
  149. data/lib/mailslurp_client/models/phone_provisioning_job_dto.rb +434 -0
  150. data/lib/mailslurp_client/models/phone_provisioning_job_item_dto.rb +336 -0
  151. data/lib/mailslurp_client/models/phone_sms_prepaid_credit_dto.rb +340 -0
  152. data/lib/mailslurp_client/models/phone_sms_prepaid_credits_dto.rb +241 -0
  153. data/lib/mailslurp_client/models/plus_address_projection.rb +27 -27
  154. data/lib/mailslurp_client/models/recipient_projection.rb +13 -13
  155. data/lib/mailslurp_client/models/reputation_item_projection.rb +41 -41
  156. data/lib/mailslurp_client/models/search_available_phone_numbers_options.rb +377 -0
  157. data/lib/mailslurp_client/models/sender_projection.rb +13 -13
  158. data/lib/mailslurp_client/models/sent_email_projection.rb +63 -63
  159. data/lib/mailslurp_client/models/sent_sms_projection.rb +18 -18
  160. data/lib/mailslurp_client/models/sms_projection.rb +18 -18
  161. data/lib/mailslurp_client/models/smtp_auth_diagnostic_result.rb +235 -0
  162. data/lib/mailslurp_client/models/smtp_diagnostic_step.rb +236 -0
  163. data/lib/mailslurp_client/models/smtp_tls_diagnostic_result.rb +245 -0
  164. data/lib/mailslurp_client/models/sort_object.rb +10 -10
  165. data/lib/mailslurp_client/models/spf_mechanism_result.rb +229 -0
  166. data/lib/mailslurp_client/models/template_projection.rb +41 -41
  167. data/lib/mailslurp_client/models/test_smtp_server_options.rb +337 -0
  168. data/lib/mailslurp_client/models/test_smtp_server_results.rb +297 -0
  169. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +27 -27
  170. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +27 -27
  171. data/lib/mailslurp_client/models/update_phone_pool_options.rb +215 -0
  172. data/lib/mailslurp_client/models/validation_dto.rb +1 -5
  173. data/lib/mailslurp_client/models/webhook_projection.rb +45 -45
  174. data/lib/mailslurp_client/version.rb +1 -1
  175. data/lib/mailslurp_client.rb +67 -0
  176. metadata +69 -2
@@ -0,0 +1,351 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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://docs.mailslurp.com/) - [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
+ class PhonePoolLeaseDto
17
+ attr_accessor :id
18
+
19
+ attr_accessor :pool_id
20
+
21
+ attr_accessor :phone_number_id
22
+
23
+ attr_accessor :phone_number
24
+
25
+ attr_accessor :phone_country
26
+
27
+ attr_accessor :phone_name
28
+
29
+ attr_accessor :lease_name
30
+
31
+ attr_accessor :lease_owner
32
+
33
+ attr_accessor :leased_at
34
+
35
+ attr_accessor :expires_at
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'id' => :'id',
63
+ :'pool_id' => :'poolId',
64
+ :'phone_number_id' => :'phoneNumberId',
65
+ :'phone_number' => :'phoneNumber',
66
+ :'phone_country' => :'phoneCountry',
67
+ :'phone_name' => :'phoneName',
68
+ :'lease_name' => :'leaseName',
69
+ :'lease_owner' => :'leaseOwner',
70
+ :'leased_at' => :'leasedAt',
71
+ :'expires_at' => :'expiresAt'
72
+ }
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'id' => :'String',
79
+ :'pool_id' => :'String',
80
+ :'phone_number_id' => :'String',
81
+ :'phone_number' => :'String',
82
+ :'phone_country' => :'String',
83
+ :'phone_name' => :'String',
84
+ :'lease_name' => :'String',
85
+ :'lease_owner' => :'String',
86
+ :'leased_at' => :'DateTime',
87
+ :'expires_at' => :'DateTime'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ ])
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ if (!attributes.is_a?(Hash))
101
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::PhonePoolLeaseDto` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!self.class.attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::PhonePoolLeaseDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'id')
113
+ self.id = attributes[:'id']
114
+ end
115
+
116
+ if attributes.key?(:'pool_id')
117
+ self.pool_id = attributes[:'pool_id']
118
+ end
119
+
120
+ if attributes.key?(:'phone_number_id')
121
+ self.phone_number_id = attributes[:'phone_number_id']
122
+ end
123
+
124
+ if attributes.key?(:'phone_number')
125
+ self.phone_number = attributes[:'phone_number']
126
+ end
127
+
128
+ if attributes.key?(:'phone_country')
129
+ self.phone_country = attributes[:'phone_country']
130
+ end
131
+
132
+ if attributes.key?(:'phone_name')
133
+ self.phone_name = attributes[:'phone_name']
134
+ end
135
+
136
+ if attributes.key?(:'lease_name')
137
+ self.lease_name = attributes[:'lease_name']
138
+ end
139
+
140
+ if attributes.key?(:'lease_owner')
141
+ self.lease_owner = attributes[:'lease_owner']
142
+ end
143
+
144
+ if attributes.key?(:'leased_at')
145
+ self.leased_at = attributes[:'leased_at']
146
+ end
147
+
148
+ if attributes.key?(:'expires_at')
149
+ self.expires_at = attributes[:'expires_at']
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ invalid_properties = Array.new
157
+ if @id.nil?
158
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
159
+ end
160
+
161
+ if @pool_id.nil?
162
+ invalid_properties.push('invalid value for "pool_id", pool_id cannot be nil.')
163
+ end
164
+
165
+ if @phone_number_id.nil?
166
+ invalid_properties.push('invalid value for "phone_number_id", phone_number_id cannot be nil.')
167
+ end
168
+
169
+ if @phone_number.nil?
170
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
171
+ end
172
+
173
+ if @phone_country.nil?
174
+ invalid_properties.push('invalid value for "phone_country", phone_country cannot be nil.')
175
+ end
176
+
177
+ if @leased_at.nil?
178
+ invalid_properties.push('invalid value for "leased_at", leased_at cannot be nil.')
179
+ end
180
+
181
+ invalid_properties
182
+ end
183
+
184
+ # Check to see if the all the properties in the model are valid
185
+ # @return true if the model is valid
186
+ def valid?
187
+ return false if @id.nil?
188
+ return false if @pool_id.nil?
189
+ return false if @phone_number_id.nil?
190
+ return false if @phone_number.nil?
191
+ return false if @phone_country.nil?
192
+ phone_country_validator = EnumAttributeValidator.new('String', ["US", "GB", "AU", "CA", "EE", "HK", "PL", "PT", "NL", "IL", "FI", "SE"])
193
+ return false unless phone_country_validator.valid?(@phone_country)
194
+ return false if @leased_at.nil?
195
+ true
196
+ end
197
+
198
+ # Custom attribute writer method checking allowed values (enum).
199
+ # @param [Object] phone_country Object to be assigned
200
+ def phone_country=(phone_country)
201
+ validator = EnumAttributeValidator.new('String', ["US", "GB", "AU", "CA", "EE", "HK", "PL", "PT", "NL", "IL", "FI", "SE"])
202
+ unless validator.valid?(phone_country)
203
+ fail ArgumentError, "invalid value for \"phone_country\", must be one of #{validator.allowable_values}."
204
+ end
205
+ @phone_country = phone_country
206
+ end
207
+
208
+ # Checks equality by comparing each attribute.
209
+ # @param [Object] Object to be compared
210
+ def ==(o)
211
+ return true if self.equal?(o)
212
+ self.class == o.class &&
213
+ id == o.id &&
214
+ pool_id == o.pool_id &&
215
+ phone_number_id == o.phone_number_id &&
216
+ phone_number == o.phone_number &&
217
+ phone_country == o.phone_country &&
218
+ phone_name == o.phone_name &&
219
+ lease_name == o.lease_name &&
220
+ lease_owner == o.lease_owner &&
221
+ leased_at == o.leased_at &&
222
+ expires_at == o.expires_at
223
+ end
224
+
225
+ # @see the `==` method
226
+ # @param [Object] Object to be compared
227
+ def eql?(o)
228
+ self == o
229
+ end
230
+
231
+ # Calculates hash code according to all attributes.
232
+ # @return [Integer] Hash code
233
+ def hash
234
+ [id, pool_id, phone_number_id, phone_number, phone_country, phone_name, lease_name, lease_owner, leased_at, expires_at].hash
235
+ end
236
+
237
+ # Builds the object from hash
238
+ # @param [Hash] attributes Model attributes in the form of hash
239
+ # @return [Object] Returns the model itself
240
+ def self.build_from_hash(attributes)
241
+ new.build_from_hash(attributes)
242
+ end
243
+
244
+ # Builds the object from hash
245
+ # @param [Hash] attributes Model attributes in the form of hash
246
+ # @return [Object] Returns the model itself
247
+ def build_from_hash(attributes)
248
+ return nil unless attributes.is_a?(Hash)
249
+ self.class.openapi_types.each_pair do |key, type|
250
+ if type =~ /\AArray<(.*)>/i
251
+ # check to ensure the input is an array given that the attribute
252
+ # is documented as an array but the input is not
253
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
254
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
255
+ end
256
+ elsif !attributes[self.class.attribute_map[key]].nil?
257
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
258
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
259
+ end
260
+
261
+ self
262
+ end
263
+
264
+ # Deserializes the data based on type
265
+ # @param string type Data type
266
+ # @param string value Value to be deserialized
267
+ # @return [Object] Deserialized data
268
+ def _deserialize(type, value)
269
+ case type.to_sym
270
+ when :DateTime
271
+ DateTime.parse(value)
272
+ when :Date
273
+ Date.parse(value)
274
+ when :String
275
+ value.to_s
276
+ when :Integer
277
+ value.to_i
278
+ when :Float
279
+ value.to_f
280
+ when :Boolean
281
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
282
+ true
283
+ else
284
+ false
285
+ end
286
+ when :Object
287
+ # generic object (usually a Hash), return directly
288
+ value
289
+ when /\AArray<(?<inner_type>.+)>\z/
290
+ inner_type = Regexp.last_match[:inner_type]
291
+ value.map { |v| _deserialize(inner_type, v) }
292
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
293
+ k_type = Regexp.last_match[:k_type]
294
+ v_type = Regexp.last_match[:v_type]
295
+ {}.tap do |hash|
296
+ value.each do |k, v|
297
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
298
+ end
299
+ end
300
+ else # model
301
+ MailSlurpClient.const_get(type).build_from_hash(value)
302
+ end
303
+ end
304
+
305
+ # Returns the string representation of the object
306
+ # @return [String] String presentation of the object
307
+ def to_s
308
+ to_hash.to_s
309
+ end
310
+
311
+ # to_body is an alias to to_hash (backward compatibility)
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_body
314
+ to_hash
315
+ end
316
+
317
+ # Returns the object in the form of hash
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ if value.nil?
324
+ is_nullable = self.class.openapi_nullable.include?(attr)
325
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
326
+ end
327
+
328
+ hash[param] = _to_hash(value)
329
+ end
330
+ hash
331
+ end
332
+
333
+ # Outputs non-array value in the form of hash
334
+ # For object, use to_hash. Otherwise, just return the value
335
+ # @param [Object] value Any valid value
336
+ # @return [Hash] Returns the value in the form of hash
337
+ def _to_hash(value)
338
+ if value.is_a?(Array)
339
+ value.compact.map { |v| _to_hash(v) }
340
+ elsif value.is_a?(Hash)
341
+ {}.tap do |hash|
342
+ value.each { |k, v| hash[k] = _to_hash(v) }
343
+ end
344
+ elsif value.respond_to? :to_hash
345
+ value.to_hash
346
+ else
347
+ value
348
+ end
349
+ end
350
+ end
351
+ end
@@ -0,0 +1,333 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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://docs.mailslurp.com/) - [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
+ class PhonePoolMemberDto
17
+ attr_accessor :id
18
+
19
+ attr_accessor :pool_id
20
+
21
+ attr_accessor :phone_number_id
22
+
23
+ attr_accessor :phone_number
24
+
25
+ attr_accessor :phone_country
26
+
27
+ attr_accessor :phone_name
28
+
29
+ attr_accessor :created_at
30
+
31
+ attr_accessor :active_lease
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'id' => :'id',
59
+ :'pool_id' => :'poolId',
60
+ :'phone_number_id' => :'phoneNumberId',
61
+ :'phone_number' => :'phoneNumber',
62
+ :'phone_country' => :'phoneCountry',
63
+ :'phone_name' => :'phoneName',
64
+ :'created_at' => :'createdAt',
65
+ :'active_lease' => :'activeLease'
66
+ }
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'id' => :'String',
73
+ :'pool_id' => :'String',
74
+ :'phone_number_id' => :'String',
75
+ :'phone_number' => :'String',
76
+ :'phone_country' => :'String',
77
+ :'phone_name' => :'String',
78
+ :'created_at' => :'DateTime',
79
+ :'active_lease' => :'PhonePoolLeaseDto'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ ])
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::PhonePoolMemberDto` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!self.class.attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::PhonePoolMemberDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'id')
105
+ self.id = attributes[:'id']
106
+ end
107
+
108
+ if attributes.key?(:'pool_id')
109
+ self.pool_id = attributes[:'pool_id']
110
+ end
111
+
112
+ if attributes.key?(:'phone_number_id')
113
+ self.phone_number_id = attributes[:'phone_number_id']
114
+ end
115
+
116
+ if attributes.key?(:'phone_number')
117
+ self.phone_number = attributes[:'phone_number']
118
+ end
119
+
120
+ if attributes.key?(:'phone_country')
121
+ self.phone_country = attributes[:'phone_country']
122
+ end
123
+
124
+ if attributes.key?(:'phone_name')
125
+ self.phone_name = attributes[:'phone_name']
126
+ end
127
+
128
+ if attributes.key?(:'created_at')
129
+ self.created_at = attributes[:'created_at']
130
+ end
131
+
132
+ if attributes.key?(:'active_lease')
133
+ self.active_lease = attributes[:'active_lease']
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+ if @id.nil?
142
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
143
+ end
144
+
145
+ if @pool_id.nil?
146
+ invalid_properties.push('invalid value for "pool_id", pool_id cannot be nil.')
147
+ end
148
+
149
+ if @phone_number_id.nil?
150
+ invalid_properties.push('invalid value for "phone_number_id", phone_number_id cannot be nil.')
151
+ end
152
+
153
+ if @phone_number.nil?
154
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
155
+ end
156
+
157
+ if @phone_country.nil?
158
+ invalid_properties.push('invalid value for "phone_country", phone_country cannot be nil.')
159
+ end
160
+
161
+ if @created_at.nil?
162
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
163
+ end
164
+
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ return false if @id.nil?
172
+ return false if @pool_id.nil?
173
+ return false if @phone_number_id.nil?
174
+ return false if @phone_number.nil?
175
+ return false if @phone_country.nil?
176
+ phone_country_validator = EnumAttributeValidator.new('String', ["US", "GB", "AU", "CA", "EE", "HK", "PL", "PT", "NL", "IL", "FI", "SE"])
177
+ return false unless phone_country_validator.valid?(@phone_country)
178
+ return false if @created_at.nil?
179
+ true
180
+ end
181
+
182
+ # Custom attribute writer method checking allowed values (enum).
183
+ # @param [Object] phone_country Object to be assigned
184
+ def phone_country=(phone_country)
185
+ validator = EnumAttributeValidator.new('String', ["US", "GB", "AU", "CA", "EE", "HK", "PL", "PT", "NL", "IL", "FI", "SE"])
186
+ unless validator.valid?(phone_country)
187
+ fail ArgumentError, "invalid value for \"phone_country\", must be one of #{validator.allowable_values}."
188
+ end
189
+ @phone_country = phone_country
190
+ end
191
+
192
+ # Checks equality by comparing each attribute.
193
+ # @param [Object] Object to be compared
194
+ def ==(o)
195
+ return true if self.equal?(o)
196
+ self.class == o.class &&
197
+ id == o.id &&
198
+ pool_id == o.pool_id &&
199
+ phone_number_id == o.phone_number_id &&
200
+ phone_number == o.phone_number &&
201
+ phone_country == o.phone_country &&
202
+ phone_name == o.phone_name &&
203
+ created_at == o.created_at &&
204
+ active_lease == o.active_lease
205
+ end
206
+
207
+ # @see the `==` method
208
+ # @param [Object] Object to be compared
209
+ def eql?(o)
210
+ self == o
211
+ end
212
+
213
+ # Calculates hash code according to all attributes.
214
+ # @return [Integer] Hash code
215
+ def hash
216
+ [id, pool_id, phone_number_id, phone_number, phone_country, phone_name, created_at, active_lease].hash
217
+ end
218
+
219
+ # Builds the object from hash
220
+ # @param [Hash] attributes Model attributes in the form of hash
221
+ # @return [Object] Returns the model itself
222
+ def self.build_from_hash(attributes)
223
+ new.build_from_hash(attributes)
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def build_from_hash(attributes)
230
+ return nil unless attributes.is_a?(Hash)
231
+ self.class.openapi_types.each_pair do |key, type|
232
+ if type =~ /\AArray<(.*)>/i
233
+ # check to ensure the input is an array given that the attribute
234
+ # is documented as an array but the input is not
235
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
236
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
237
+ end
238
+ elsif !attributes[self.class.attribute_map[key]].nil?
239
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
240
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
241
+ end
242
+
243
+ self
244
+ end
245
+
246
+ # Deserializes the data based on type
247
+ # @param string type Data type
248
+ # @param string value Value to be deserialized
249
+ # @return [Object] Deserialized data
250
+ def _deserialize(type, value)
251
+ case type.to_sym
252
+ when :DateTime
253
+ DateTime.parse(value)
254
+ when :Date
255
+ Date.parse(value)
256
+ when :String
257
+ value.to_s
258
+ when :Integer
259
+ value.to_i
260
+ when :Float
261
+ value.to_f
262
+ when :Boolean
263
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
264
+ true
265
+ else
266
+ false
267
+ end
268
+ when :Object
269
+ # generic object (usually a Hash), return directly
270
+ value
271
+ when /\AArray<(?<inner_type>.+)>\z/
272
+ inner_type = Regexp.last_match[:inner_type]
273
+ value.map { |v| _deserialize(inner_type, v) }
274
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
275
+ k_type = Regexp.last_match[:k_type]
276
+ v_type = Regexp.last_match[:v_type]
277
+ {}.tap do |hash|
278
+ value.each do |k, v|
279
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
280
+ end
281
+ end
282
+ else # model
283
+ MailSlurpClient.const_get(type).build_from_hash(value)
284
+ end
285
+ end
286
+
287
+ # Returns the string representation of the object
288
+ # @return [String] String presentation of the object
289
+ def to_s
290
+ to_hash.to_s
291
+ end
292
+
293
+ # to_body is an alias to to_hash (backward compatibility)
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_body
296
+ to_hash
297
+ end
298
+
299
+ # Returns the object in the form of hash
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_hash
302
+ hash = {}
303
+ self.class.attribute_map.each_pair do |attr, param|
304
+ value = self.send(attr)
305
+ if value.nil?
306
+ is_nullable = self.class.openapi_nullable.include?(attr)
307
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
308
+ end
309
+
310
+ hash[param] = _to_hash(value)
311
+ end
312
+ hash
313
+ end
314
+
315
+ # Outputs non-array value in the form of hash
316
+ # For object, use to_hash. Otherwise, just return the value
317
+ # @param [Object] value Any valid value
318
+ # @return [Hash] Returns the value in the form of hash
319
+ def _to_hash(value)
320
+ if value.is_a?(Array)
321
+ value.compact.map { |v| _to_hash(v) }
322
+ elsif value.is_a?(Hash)
323
+ {}.tap do |hash|
324
+ value.each { |k, v| hash[k] = _to_hash(v) }
325
+ end
326
+ elsif value.respond_to? :to_hash
327
+ value.to_hash
328
+ else
329
+ value
330
+ end
331
+ end
332
+ end
333
+ end