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