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
+ # Request options for running email intelligence checks on one or more inputs.
17
+ class EmailIntelligenceOptions
18
+ # Email addresses or domains to score.
19
+ attr_accessor :targets
20
+
21
+ # Zero-based page index for processing a subset of the target list.
22
+ attr_accessor :page
23
+
24
+ # Page size for processing a subset of the target list.
25
+ attr_accessor :size
26
+
27
+ # Ignore cached intelligence values and force recomputation.
28
+ attr_accessor :ignore_cache
29
+
30
+ # Also run mailbox safety verification using the existing verification client for email inputs.
31
+ attr_accessor :include_email_validation
32
+
33
+ attr_accessor :tests
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'targets' => :'targets',
39
+ :'page' => :'page',
40
+ :'size' => :'size',
41
+ :'ignore_cache' => :'ignoreCache',
42
+ :'include_email_validation' => :'includeEmailValidation',
43
+ :'tests' => :'tests'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'targets' => :'Array<String>',
51
+ :'page' => :'Integer',
52
+ :'size' => :'Integer',
53
+ :'ignore_cache' => :'Boolean',
54
+ :'include_email_validation' => :'Boolean',
55
+ :'tests' => :'EmailIntelligenceTestsOptions'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ :'page',
63
+ :'size',
64
+ :'ignore_cache',
65
+ :'include_email_validation',
66
+ :'tests'
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::EmailIntelligenceOptions` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::EmailIntelligenceOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'targets')
86
+ if (value = attributes[:'targets']).is_a?(Array)
87
+ self.targets = value
88
+ end
89
+ end
90
+
91
+ if attributes.key?(:'page')
92
+ self.page = attributes[:'page']
93
+ end
94
+
95
+ if attributes.key?(:'size')
96
+ self.size = attributes[:'size']
97
+ end
98
+
99
+ if attributes.key?(:'ignore_cache')
100
+ self.ignore_cache = attributes[:'ignore_cache']
101
+ end
102
+
103
+ if attributes.key?(:'include_email_validation')
104
+ self.include_email_validation = attributes[:'include_email_validation']
105
+ end
106
+
107
+ if attributes.key?(:'tests')
108
+ self.tests = attributes[:'tests']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ invalid_properties = Array.new
116
+ if @targets.nil?
117
+ invalid_properties.push('invalid value for "targets", targets cannot be nil.')
118
+ end
119
+
120
+ if !@page.nil? && @page < 0
121
+ invalid_properties.push('invalid value for "page", must be greater than or equal to 0.')
122
+ end
123
+
124
+ if !@size.nil? && @size > 500
125
+ invalid_properties.push('invalid value for "size", must be smaller than or equal to 500.')
126
+ end
127
+
128
+ if !@size.nil? && @size < 1
129
+ invalid_properties.push('invalid value for "size", must be greater than or equal to 1.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ return false if @targets.nil?
139
+ return false if !@page.nil? && @page < 0
140
+ return false if !@size.nil? && @size > 500
141
+ return false if !@size.nil? && @size < 1
142
+ true
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] page Value to be assigned
147
+ def page=(page)
148
+ if !page.nil? && page < 0
149
+ fail ArgumentError, 'invalid value for "page", must be greater than or equal to 0.'
150
+ end
151
+
152
+ @page = page
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] size Value to be assigned
157
+ def size=(size)
158
+ if !size.nil? && size > 500
159
+ fail ArgumentError, 'invalid value for "size", must be smaller than or equal to 500.'
160
+ end
161
+
162
+ if !size.nil? && size < 1
163
+ fail ArgumentError, 'invalid value for "size", must be greater than or equal to 1.'
164
+ end
165
+
166
+ @size = size
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] Object to be compared
171
+ def ==(o)
172
+ return true if self.equal?(o)
173
+ self.class == o.class &&
174
+ targets == o.targets &&
175
+ page == o.page &&
176
+ size == o.size &&
177
+ ignore_cache == o.ignore_cache &&
178
+ include_email_validation == o.include_email_validation &&
179
+ tests == o.tests
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
+ [targets, page, size, ignore_cache, include_email_validation, tests].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,256 @@
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
+ # Email intelligence result for a single input.
17
+ class EmailIntelligenceResultDto
18
+ # Original input value before normalization.
19
+ attr_accessor :input
20
+
21
+ # Score from 0 to 100 where higher is better.
22
+ attr_accessor :total_score
23
+
24
+ attr_accessor :score_breakdown
25
+
26
+ attr_accessor :signals
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'input' => :'input',
32
+ :'total_score' => :'totalScore',
33
+ :'score_breakdown' => :'scoreBreakdown',
34
+ :'signals' => :'signals'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'input' => :'String',
42
+ :'total_score' => :'Integer',
43
+ :'score_breakdown' => :'EmailIntelligenceScoreBreakdownDto',
44
+ :'signals' => :'EmailIntelligenceSignalsDto'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::EmailIntelligenceResultDto` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::EmailIntelligenceResultDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'input')
70
+ self.input = attributes[:'input']
71
+ end
72
+
73
+ if attributes.key?(:'total_score')
74
+ self.total_score = attributes[:'total_score']
75
+ end
76
+
77
+ if attributes.key?(:'score_breakdown')
78
+ self.score_breakdown = attributes[:'score_breakdown']
79
+ end
80
+
81
+ if attributes.key?(:'signals')
82
+ self.signals = attributes[:'signals']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @input.nil?
91
+ invalid_properties.push('invalid value for "input", input cannot be nil.')
92
+ end
93
+
94
+ if @total_score.nil?
95
+ invalid_properties.push('invalid value for "total_score", total_score cannot be nil.')
96
+ end
97
+
98
+ if @score_breakdown.nil?
99
+ invalid_properties.push('invalid value for "score_breakdown", score_breakdown cannot be nil.')
100
+ end
101
+
102
+ if @signals.nil?
103
+ invalid_properties.push('invalid value for "signals", signals cannot be nil.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ return false if @input.nil?
113
+ return false if @total_score.nil?
114
+ return false if @score_breakdown.nil?
115
+ return false if @signals.nil?
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ input == o.input &&
125
+ total_score == o.total_score &&
126
+ score_breakdown == o.score_breakdown &&
127
+ signals == o.signals
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [input, total_score, score_breakdown, signals].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ new.build_from_hash(attributes)
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :DateTime
176
+ DateTime.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ MailSlurpClient.const_get(type).build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ if value.nil?
229
+ is_nullable = self.class.openapi_nullable.include?(attr)
230
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
231
+ end
232
+
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+ end
256
+ end