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