opportify-sdk 0.1.1__py3-none-any.whl → 0.3.1__py3-none-any.whl

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.

Potentially problematic release.


This version of opportify-sdk might be problematic. Click here for more details.

Files changed (113) hide show
  1. openapi_client/__init__.py +186 -0
  2. openapi_client/api/email_insights_api.py +1491 -0
  3. openapi_client/api/ip_insights_api.py +1494 -0
  4. {lib/v1/openapi_client → openapi_client}/api_client.py +14 -7
  5. {lib/v1/openapi_client → openapi_client}/configuration.py +16 -5
  6. {lib/v1/openapi_client → openapi_client}/exceptions.py +18 -1
  7. openapi_client/models/__init__.py +84 -0
  8. {lib/v1/openapi_client → openapi_client}/models/abuse_contact.py +1 -1
  9. openapi_client/models/address_signals.py +99 -0
  10. {lib/v1/openapi_client → openapi_client}/models/admin_contact.py +1 -1
  11. openapi_client/models/analyze_email200_response.py +127 -0
  12. lib/v1/openapi_client/models/analyze_email400_response_error.py → openapi_client/models/analyze_email400_response.py +9 -9
  13. openapi_client/models/analyze_email403_response.py +207 -0
  14. openapi_client/models/analyze_email500_response.py +89 -0
  15. openapi_client/models/analyze_email_request.py +94 -0
  16. {lib/v1/openapi_client → openapi_client}/models/analyze_ip200_response.py +4 -4
  17. lib/v1/openapi_client/models/analyze_ip400_response_error.py → openapi_client/models/analyze_ip400_response.py +20 -20
  18. {lib/v1/openapi_client → openapi_client}/models/analyze_ip_request.py +1 -1
  19. {lib/v1/openapi_client → openapi_client}/models/asn.py +1 -1
  20. openapi_client/models/batch_analyze_emails202_response.py +93 -0
  21. openapi_client/models/batch_analyze_emails400_response.py +137 -0
  22. openapi_client/models/batch_analyze_emails401_response.py +89 -0
  23. openapi_client/models/batch_analyze_emails402_response.py +137 -0
  24. openapi_client/models/batch_analyze_emails403_response.py +193 -0
  25. openapi_client/models/batch_analyze_emails413_response.py +89 -0
  26. openapi_client/models/batch_analyze_emails429_response.py +89 -0
  27. openapi_client/models/batch_analyze_emails_request.py +93 -0
  28. openapi_client/models/batch_analyze_ips202_response.py +93 -0
  29. openapi_client/models/batch_analyze_ips400_response.py +137 -0
  30. openapi_client/models/batch_analyze_ips_request.py +91 -0
  31. {lib/v1/openapi_client → openapi_client}/models/block_listed.py +3 -4
  32. openapi_client/models/create_email_batch_export400_response.py +89 -0
  33. openapi_client/models/create_email_batch_export403_response.py +89 -0
  34. openapi_client/models/create_email_batch_export404_response.py +89 -0
  35. openapi_client/models/create_email_batch_export409_response.py +137 -0
  36. openapi_client/models/email_dns.py +97 -0
  37. openapi_client/models/email_domain.py +113 -0
  38. openapi_client/models/export_created_response.py +91 -0
  39. openapi_client/models/export_filter.py +95 -0
  40. openapi_client/models/export_request.py +92 -0
  41. openapi_client/models/export_status_response.py +119 -0
  42. openapi_client/models/exportnotfound.py +89 -0
  43. openapi_client/models/forbidden.py +89 -0
  44. {lib/v1/openapi_client → openapi_client}/models/geo.py +1 -1
  45. openapi_client/models/get_email_batch_export_status400_response.py +89 -0
  46. openapi_client/models/get_email_batch_export_status404_response.py +137 -0
  47. openapi_client/models/get_email_batch_status200_response.py +101 -0
  48. openapi_client/models/get_email_batch_status200_response_download_urls.py +93 -0
  49. openapi_client/models/get_email_batch_status404_response.py +89 -0
  50. openapi_client/models/get_ip_batch_status200_response.py +101 -0
  51. openapi_client/models/internalerror.py +89 -0
  52. openapi_client/models/internalerror1.py +89 -0
  53. openapi_client/models/invaliddata.py +89 -0
  54. openapi_client/models/invaliddata1.py +89 -0
  55. openapi_client/models/invalidemail.py +89 -0
  56. openapi_client/models/invalidplan.py +89 -0
  57. openapi_client/models/invalidplan1.py +89 -0
  58. openapi_client/models/invalidtoken.py +89 -0
  59. openapi_client/models/ipvalidationfailed.py +89 -0
  60. openapi_client/models/jobnotfound.py +89 -0
  61. openapi_client/models/jobnotready.py +89 -0
  62. openapi_client/models/malformedrequest.py +89 -0
  63. openapi_client/models/malformedrequest1.py +89 -0
  64. openapi_client/models/malformedrequest2.py +89 -0
  65. openapi_client/models/malformedrequest3.py +89 -0
  66. openapi_client/models/manifestnotavailable.py +89 -0
  67. openapi_client/models/notfound.py +89 -0
  68. {lib/v1/openapi_client → openapi_client}/models/organization.py +1 -1
  69. openapi_client/models/quotaexceeded.py +89 -0
  70. openapi_client/models/risk_report_email.py +92 -0
  71. openapi_client/models/risk_report_ip.py +89 -0
  72. {lib/v1/openapi_client → openapi_client}/models/tech_contact.py +1 -1
  73. openapi_client/models/toomanyrequests.py +89 -0
  74. {lib/v1/openapi_client → openapi_client}/models/trusted_provider.py +1 -1
  75. {lib/v1/openapi_client → openapi_client}/models/whois.py +2 -2
  76. {lib/v1/openapi_client → openapi_client}/rest.py +2 -1
  77. opportify_sdk/email_insights.py +427 -0
  78. opportify_sdk/ip_insights.py +410 -0
  79. opportify_sdk-0.3.1.dist-info/METADATA +300 -0
  80. opportify_sdk-0.3.1.dist-info/RECORD +86 -0
  81. {opportify_sdk-0.1.1.dist-info → opportify_sdk-0.3.1.dist-info}/WHEEL +1 -1
  82. opportify_sdk-0.3.1.dist-info/top_level.txt +2 -0
  83. lib/__init__.py +0 -0
  84. lib/v1/__init__.py +0 -0
  85. lib/v1/openapi_client/__init__.py +0 -63
  86. lib/v1/openapi_client/api/email_insights_api.py +0 -317
  87. lib/v1/openapi_client/api/ip_insights_api.py +0 -322
  88. lib/v1/openapi_client/models/__init__.py +0 -45
  89. lib/v1/openapi_client/models/analyze_email200_response.py +0 -113
  90. lib/v1/openapi_client/models/analyze_email400_response.py +0 -91
  91. lib/v1/openapi_client/models/analyze_email500_response.py +0 -91
  92. lib/v1/openapi_client/models/analyze_email500_response_error.py +0 -89
  93. lib/v1/openapi_client/models/analyze_email_request.py +0 -92
  94. lib/v1/openapi_client/models/analyze_ip400_response.py +0 -91
  95. lib/v1/openapi_client/models/analyze_ip404_response.py +0 -91
  96. lib/v1/openapi_client/models/analyze_ip500_response.py +0 -91
  97. lib/v1/openapi_client/models/email_dns.py +0 -87
  98. lib/v1/openapi_client/models/internalerror.py +0 -89
  99. lib/v1/openapi_client/models/invalidemail.py +0 -89
  100. lib/v1/openapi_client/models/ipvalidationfailed.py +0 -89
  101. lib/v1/openapi_client/models/malformedrequest.py +0 -89
  102. lib/v1/openapi_client/models/malformedrequest1.py +0 -89
  103. lib/v1/openapi_client/models/notfound.py +0 -89
  104. lib/v1/openapi_client/models/risk_report.py +0 -89
  105. opportify_sdk-0.1.1.dist-info/METADATA +0 -108
  106. opportify_sdk-0.1.1.dist-info/RECORD +0 -49
  107. opportify_sdk-0.1.1.dist-info/top_level.txt +0 -2
  108. src/email_insights.py +0 -97
  109. src/ip_insights.py +0 -93
  110. {lib/v1/openapi_client → openapi_client}/api/__init__.py +0 -0
  111. {lib/v1/openapi_client → openapi_client}/api_response.py +0 -0
  112. {lib/v1/openapi_client → openapi_client}/py.typed +0 -0
  113. {src → opportify_sdk}/__init__.py +0 -0
@@ -0,0 +1,1491 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Opportify Insights API
5
+
6
+ ## Overview The **Opportify Insights API** provides access to a powerful and up-to-date platform. With advanced data warehousing and AI-driven capabilities, this API is designed to empower your business to make informed, data-driven decisions and effectively assess potential risks. ### Base URL Use the following base URL for all API requests: ```plaintext https://api.opportify.ai/insights/v1/<service>/<endpoint> ``` ### Features - [**Email Insights:**](/docs/api/api-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, private or unknown). - Real time verifications: - Reachable: Confirms if the email domain has valid MX DNS records using DNS lookup. - Deliverable: Simulates an SMTP handshake to check if the email address exists and is deliverable. - Catch-All: Detects if the domain accepts all emails (catch-all configuration). - Intelligent Error Correction: Automatically corrects well-known misspelled email addresses. - Risk Report: Provides an AI-driven normalized score (200-1000) to evaluate email risk, using predefined thresholds. [Access Documentation >>](/docs/api/api-reference/email-insights) - [**IP Insights:**](/docs/api/api-reference/ip-insights) - Connection types: Detects connection types such as `wired`, `mobile`, `enterprise`, `satellite`, `VPN`, `cloud-provider`, `open-proxy`, or `Tor`. - Geo location: Delivers detailed insights such as country, city, timezone, language preferences, and additional location-based information to enhance regional understanding. - WHOIS: Provides main details including RIR, ASN, organization, and abuse/admin/technical contacts. - Trusted Provider Recognition: Identifies if the IP is part of a known trusted provider (e.g., ZTNA - Zero Trust Network Access). - Blocklist Reports: Retrieves up-to-date blocklist statuses, active reports, and the latest detections. - Risk Report: Delivers an AI-driven normalized score (200-1000) to evaluate IP risk, supported by predefined thresholds. [Access Documentation >>](/docs/api/api-reference/ip-insights) ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictStr
20
+ from typing import Optional
21
+ from typing_extensions import Annotated
22
+ from openapi_client.models.analyze_email200_response import AnalyzeEmail200Response
23
+ from openapi_client.models.analyze_email_request import AnalyzeEmailRequest
24
+ from openapi_client.models.batch_analyze_emails202_response import BatchAnalyzeEmails202Response
25
+ from openapi_client.models.batch_analyze_emails_request import BatchAnalyzeEmailsRequest
26
+ from openapi_client.models.export_created_response import ExportCreatedResponse
27
+ from openapi_client.models.export_request import ExportRequest
28
+ from openapi_client.models.export_status_response import ExportStatusResponse
29
+ from openapi_client.models.get_email_batch_status200_response import GetEmailBatchStatus200Response
30
+
31
+ from openapi_client.api_client import ApiClient, RequestSerialized
32
+ from openapi_client.api_response import ApiResponse
33
+ from openapi_client.rest import RESTResponseType
34
+
35
+
36
+ class EmailInsightsApi:
37
+ """NOTE: This class is auto generated by OpenAPI Generator
38
+ Ref: https://openapi-generator.tech
39
+
40
+ Do not edit the class manually.
41
+ """
42
+
43
+ def __init__(self, api_client=None) -> None:
44
+ if api_client is None:
45
+ api_client = ApiClient.get_default()
46
+ self.api_client = api_client
47
+
48
+
49
+ @validate_call
50
+ def analyze_email(
51
+ self,
52
+ analyze_email_request: AnalyzeEmailRequest,
53
+ _request_timeout: Union[
54
+ None,
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Tuple[
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Annotated[StrictFloat, Field(gt=0)]
59
+ ]
60
+ ] = None,
61
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
+ _content_type: Optional[StrictStr] = None,
63
+ _headers: Optional[Dict[StrictStr, Any]] = None,
64
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
+ ) -> AnalyzeEmail200Response:
66
+ """Analyze Email
67
+
68
+ The **Analyze Email** endpoint validates an email address and returns its deliverability status, provider details, and potential corrections. This endpoint is ideal for ensuring accurate email data before usage. ### Features: - **Syntax intelligence:** Validates RFC compliance, normalizes casing, and suggests corrections for typo-prone domains. - **Provider & classification:** Identifies the provider slug, detects private/free/disposable usage, and flags role or no-reply inboxes. - **Live deliverability checks:** Performs DNS reachability, SMTP handshakes, catch-all detection, and mailbox-full assessments in real time. - **AI risk reporting:** Returns a normalized 200–1000 score with the top weighted reason codes and guardrails for high-risk findings. - **Domain enrichment & DNS snapshot:** Surfaces registrar, age, security posture, and priority-ordered MX records when enrichment is enabled. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": true, \"enableDomainEnrichment\": true } ``` ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
69
+
70
+ :param analyze_email_request: (required)
71
+ :type analyze_email_request: AnalyzeEmailRequest
72
+ :param _request_timeout: timeout setting for this request. If one
73
+ number provided, it will be total request
74
+ timeout. It can also be a pair (tuple) of
75
+ (connection, read) timeouts.
76
+ :type _request_timeout: int, tuple(int, int), optional
77
+ :param _request_auth: set to override the auth_settings for an a single
78
+ request; this effectively ignores the
79
+ authentication in the spec for a single request.
80
+ :type _request_auth: dict, optional
81
+ :param _content_type: force content-type for the request.
82
+ :type _content_type: str, Optional
83
+ :param _headers: set to override the headers for a single
84
+ request; this effectively ignores the headers
85
+ in the spec for a single request.
86
+ :type _headers: dict, optional
87
+ :param _host_index: set to override the host_index for a single
88
+ request; this effectively ignores the host_index
89
+ in the spec for a single request.
90
+ :type _host_index: int, optional
91
+ :return: Returns the result object.
92
+ """ # noqa: E501
93
+
94
+ _param = self._analyze_email_serialize(
95
+ analyze_email_request=analyze_email_request,
96
+ _request_auth=_request_auth,
97
+ _content_type=_content_type,
98
+ _headers=_headers,
99
+ _host_index=_host_index
100
+ )
101
+
102
+ _response_types_map: Dict[str, Optional[str]] = {
103
+ '200': "AnalyzeEmail200Response",
104
+ '400': "AnalyzeEmail400Response",
105
+ '403': "AnalyzeEmail403Response",
106
+ '500': "AnalyzeEmail500Response",
107
+ }
108
+ response_data = self.api_client.call_api(
109
+ *_param,
110
+ _request_timeout=_request_timeout
111
+ )
112
+ response_data.read()
113
+ return self.api_client.response_deserialize(
114
+ response_data=response_data,
115
+ response_types_map=_response_types_map,
116
+ ).data
117
+
118
+
119
+ @validate_call
120
+ def analyze_email_with_http_info(
121
+ self,
122
+ analyze_email_request: AnalyzeEmailRequest,
123
+ _request_timeout: Union[
124
+ None,
125
+ Annotated[StrictFloat, Field(gt=0)],
126
+ Tuple[
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Annotated[StrictFloat, Field(gt=0)]
129
+ ]
130
+ ] = None,
131
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
132
+ _content_type: Optional[StrictStr] = None,
133
+ _headers: Optional[Dict[StrictStr, Any]] = None,
134
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
135
+ ) -> ApiResponse[AnalyzeEmail200Response]:
136
+ """Analyze Email
137
+
138
+ The **Analyze Email** endpoint validates an email address and returns its deliverability status, provider details, and potential corrections. This endpoint is ideal for ensuring accurate email data before usage. ### Features: - **Syntax intelligence:** Validates RFC compliance, normalizes casing, and suggests corrections for typo-prone domains. - **Provider & classification:** Identifies the provider slug, detects private/free/disposable usage, and flags role or no-reply inboxes. - **Live deliverability checks:** Performs DNS reachability, SMTP handshakes, catch-all detection, and mailbox-full assessments in real time. - **AI risk reporting:** Returns a normalized 200–1000 score with the top weighted reason codes and guardrails for high-risk findings. - **Domain enrichment & DNS snapshot:** Surfaces registrar, age, security posture, and priority-ordered MX records when enrichment is enabled. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": true, \"enableDomainEnrichment\": true } ``` ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
139
+
140
+ :param analyze_email_request: (required)
141
+ :type analyze_email_request: AnalyzeEmailRequest
142
+ :param _request_timeout: timeout setting for this request. If one
143
+ number provided, it will be total request
144
+ timeout. It can also be a pair (tuple) of
145
+ (connection, read) timeouts.
146
+ :type _request_timeout: int, tuple(int, int), optional
147
+ :param _request_auth: set to override the auth_settings for an a single
148
+ request; this effectively ignores the
149
+ authentication in the spec for a single request.
150
+ :type _request_auth: dict, optional
151
+ :param _content_type: force content-type for the request.
152
+ :type _content_type: str, Optional
153
+ :param _headers: set to override the headers for a single
154
+ request; this effectively ignores the headers
155
+ in the spec for a single request.
156
+ :type _headers: dict, optional
157
+ :param _host_index: set to override the host_index for a single
158
+ request; this effectively ignores the host_index
159
+ in the spec for a single request.
160
+ :type _host_index: int, optional
161
+ :return: Returns the result object.
162
+ """ # noqa: E501
163
+
164
+ _param = self._analyze_email_serialize(
165
+ analyze_email_request=analyze_email_request,
166
+ _request_auth=_request_auth,
167
+ _content_type=_content_type,
168
+ _headers=_headers,
169
+ _host_index=_host_index
170
+ )
171
+
172
+ _response_types_map: Dict[str, Optional[str]] = {
173
+ '200': "AnalyzeEmail200Response",
174
+ '400': "AnalyzeEmail400Response",
175
+ '403': "AnalyzeEmail403Response",
176
+ '500': "AnalyzeEmail500Response",
177
+ }
178
+ response_data = self.api_client.call_api(
179
+ *_param,
180
+ _request_timeout=_request_timeout
181
+ )
182
+ response_data.read()
183
+ return self.api_client.response_deserialize(
184
+ response_data=response_data,
185
+ response_types_map=_response_types_map,
186
+ )
187
+
188
+
189
+ @validate_call
190
+ def analyze_email_without_preload_content(
191
+ self,
192
+ analyze_email_request: AnalyzeEmailRequest,
193
+ _request_timeout: Union[
194
+ None,
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Tuple[
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Annotated[StrictFloat, Field(gt=0)]
199
+ ]
200
+ ] = None,
201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
+ _content_type: Optional[StrictStr] = None,
203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
+ ) -> RESTResponseType:
206
+ """Analyze Email
207
+
208
+ The **Analyze Email** endpoint validates an email address and returns its deliverability status, provider details, and potential corrections. This endpoint is ideal for ensuring accurate email data before usage. ### Features: - **Syntax intelligence:** Validates RFC compliance, normalizes casing, and suggests corrections for typo-prone domains. - **Provider & classification:** Identifies the provider slug, detects private/free/disposable usage, and flags role or no-reply inboxes. - **Live deliverability checks:** Performs DNS reachability, SMTP handshakes, catch-all detection, and mailbox-full assessments in real time. - **AI risk reporting:** Returns a normalized 200–1000 score with the top weighted reason codes and guardrails for high-risk findings. - **Domain enrichment & DNS snapshot:** Surfaces registrar, age, security posture, and priority-ordered MX records when enrichment is enabled. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": true, \"enableDomainEnrichment\": true } ``` ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
209
+
210
+ :param analyze_email_request: (required)
211
+ :type analyze_email_request: AnalyzeEmailRequest
212
+ :param _request_timeout: timeout setting for this request. If one
213
+ number provided, it will be total request
214
+ timeout. It can also be a pair (tuple) of
215
+ (connection, read) timeouts.
216
+ :type _request_timeout: int, tuple(int, int), optional
217
+ :param _request_auth: set to override the auth_settings for an a single
218
+ request; this effectively ignores the
219
+ authentication in the spec for a single request.
220
+ :type _request_auth: dict, optional
221
+ :param _content_type: force content-type for the request.
222
+ :type _content_type: str, Optional
223
+ :param _headers: set to override the headers for a single
224
+ request; this effectively ignores the headers
225
+ in the spec for a single request.
226
+ :type _headers: dict, optional
227
+ :param _host_index: set to override the host_index for a single
228
+ request; this effectively ignores the host_index
229
+ in the spec for a single request.
230
+ :type _host_index: int, optional
231
+ :return: Returns the result object.
232
+ """ # noqa: E501
233
+
234
+ _param = self._analyze_email_serialize(
235
+ analyze_email_request=analyze_email_request,
236
+ _request_auth=_request_auth,
237
+ _content_type=_content_type,
238
+ _headers=_headers,
239
+ _host_index=_host_index
240
+ )
241
+
242
+ _response_types_map: Dict[str, Optional[str]] = {
243
+ '200': "AnalyzeEmail200Response",
244
+ '400': "AnalyzeEmail400Response",
245
+ '403': "AnalyzeEmail403Response",
246
+ '500': "AnalyzeEmail500Response",
247
+ }
248
+ response_data = self.api_client.call_api(
249
+ *_param,
250
+ _request_timeout=_request_timeout
251
+ )
252
+ return response_data.response
253
+
254
+
255
+ def _analyze_email_serialize(
256
+ self,
257
+ analyze_email_request,
258
+ _request_auth,
259
+ _content_type,
260
+ _headers,
261
+ _host_index,
262
+ ) -> RequestSerialized:
263
+
264
+ _host = None
265
+
266
+ _collection_formats: Dict[str, str] = {
267
+ }
268
+
269
+ _path_params: Dict[str, str] = {}
270
+ _query_params: List[Tuple[str, str]] = []
271
+ _header_params: Dict[str, Optional[str]] = _headers or {}
272
+ _form_params: List[Tuple[str, str]] = []
273
+ _files: Dict[
274
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
275
+ ] = {}
276
+ _body_params: Optional[bytes] = None
277
+
278
+ # process the path parameters
279
+ # process the query parameters
280
+ # process the header parameters
281
+ # process the form parameters
282
+ # process the body parameter
283
+ if analyze_email_request is not None:
284
+ _body_params = analyze_email_request
285
+
286
+
287
+ # set the HTTP header `Accept`
288
+ if 'Accept' not in _header_params:
289
+ _header_params['Accept'] = self.api_client.select_header_accept(
290
+ [
291
+ 'application/json'
292
+ ]
293
+ )
294
+
295
+ # set the HTTP header `Content-Type`
296
+ if _content_type:
297
+ _header_params['Content-Type'] = _content_type
298
+ else:
299
+ _default_content_type = (
300
+ self.api_client.select_header_content_type(
301
+ [
302
+ 'application/json'
303
+ ]
304
+ )
305
+ )
306
+ if _default_content_type is not None:
307
+ _header_params['Content-Type'] = _default_content_type
308
+
309
+ # authentication setting
310
+ _auth_settings: List[str] = [
311
+ 'opportifyToken'
312
+ ]
313
+
314
+ return self.api_client.param_serialize(
315
+ method='POST',
316
+ resource_path='/email/analyze',
317
+ path_params=_path_params,
318
+ query_params=_query_params,
319
+ header_params=_header_params,
320
+ body=_body_params,
321
+ post_params=_form_params,
322
+ files=_files,
323
+ auth_settings=_auth_settings,
324
+ collection_formats=_collection_formats,
325
+ _host=_host,
326
+ _request_auth=_request_auth
327
+ )
328
+
329
+
330
+
331
+
332
+ @validate_call
333
+ def batch_analyze_emails(
334
+ self,
335
+ batch_analyze_emails_request: BatchAnalyzeEmailsRequest,
336
+ _request_timeout: Union[
337
+ None,
338
+ Annotated[StrictFloat, Field(gt=0)],
339
+ Tuple[
340
+ Annotated[StrictFloat, Field(gt=0)],
341
+ Annotated[StrictFloat, Field(gt=0)]
342
+ ]
343
+ ] = None,
344
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
345
+ _content_type: Optional[StrictStr] = None,
346
+ _headers: Optional[Dict[StrictStr, Any]] = None,
347
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
348
+ ) -> BatchAnalyzeEmails202Response:
349
+ """Batch Analyze Emails
350
+
351
+ The **Batch Analyze Emails** endpoint enables processing of large volumes of email addresses asynchronously. This endpoint accepts various input formats and returns a job ID for tracking the analysis progress. ### Features: - **Asynchronous Processing**: Submit large lists of emails for background processing. - **Multiple Input Formats**: Submit data as JSON arrays, tabular CSV/TSV/XLSX uploads, or line-separated text. - **Job Tracking**: Monitor processing status using the returned job ID. ### Example JSON Request: ```json { \"emails\": [ \"first-email@domain.com\", \"second-email@domain.com\" ], \"name\": \"my list of emails\", \"enableAI\": true, \"enableAutoCorrection\": true } ``` ### Authentication & Security - **API Key:** Access requires an API key in the request headers. - **ACL Rules:** Optional IP-based access restrictions for enhanced security. - **No Query Parameters:** All data is transmitted securely through headers or request body. ### Payload Limits - Maximum payload size: 3MB
352
+
353
+ :param batch_analyze_emails_request: (required)
354
+ :type batch_analyze_emails_request: BatchAnalyzeEmailsRequest
355
+ :param _request_timeout: timeout setting for this request. If one
356
+ number provided, it will be total request
357
+ timeout. It can also be a pair (tuple) of
358
+ (connection, read) timeouts.
359
+ :type _request_timeout: int, tuple(int, int), optional
360
+ :param _request_auth: set to override the auth_settings for an a single
361
+ request; this effectively ignores the
362
+ authentication in the spec for a single request.
363
+ :type _request_auth: dict, optional
364
+ :param _content_type: force content-type for the request.
365
+ :type _content_type: str, Optional
366
+ :param _headers: set to override the headers for a single
367
+ request; this effectively ignores the headers
368
+ in the spec for a single request.
369
+ :type _headers: dict, optional
370
+ :param _host_index: set to override the host_index for a single
371
+ request; this effectively ignores the host_index
372
+ in the spec for a single request.
373
+ :type _host_index: int, optional
374
+ :return: Returns the result object.
375
+ """ # noqa: E501
376
+
377
+ _param = self._batch_analyze_emails_serialize(
378
+ batch_analyze_emails_request=batch_analyze_emails_request,
379
+ _request_auth=_request_auth,
380
+ _content_type=_content_type,
381
+ _headers=_headers,
382
+ _host_index=_host_index
383
+ )
384
+
385
+ _response_types_map: Dict[str, Optional[str]] = {
386
+ '202': "BatchAnalyzeEmails202Response",
387
+ '400': "BatchAnalyzeEmails400Response",
388
+ '401': "BatchAnalyzeEmails401Response",
389
+ '402': "BatchAnalyzeEmails402Response",
390
+ '403': "BatchAnalyzeEmails403Response",
391
+ '413': "BatchAnalyzeEmails413Response",
392
+ '429': "BatchAnalyzeEmails429Response",
393
+ '500': "AnalyzeEmail500Response",
394
+ }
395
+ response_data = self.api_client.call_api(
396
+ *_param,
397
+ _request_timeout=_request_timeout
398
+ )
399
+ response_data.read()
400
+ return self.api_client.response_deserialize(
401
+ response_data=response_data,
402
+ response_types_map=_response_types_map,
403
+ ).data
404
+
405
+
406
+ @validate_call
407
+ def batch_analyze_emails_with_http_info(
408
+ self,
409
+ batch_analyze_emails_request: BatchAnalyzeEmailsRequest,
410
+ _request_timeout: Union[
411
+ None,
412
+ Annotated[StrictFloat, Field(gt=0)],
413
+ Tuple[
414
+ Annotated[StrictFloat, Field(gt=0)],
415
+ Annotated[StrictFloat, Field(gt=0)]
416
+ ]
417
+ ] = None,
418
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
419
+ _content_type: Optional[StrictStr] = None,
420
+ _headers: Optional[Dict[StrictStr, Any]] = None,
421
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
422
+ ) -> ApiResponse[BatchAnalyzeEmails202Response]:
423
+ """Batch Analyze Emails
424
+
425
+ The **Batch Analyze Emails** endpoint enables processing of large volumes of email addresses asynchronously. This endpoint accepts various input formats and returns a job ID for tracking the analysis progress. ### Features: - **Asynchronous Processing**: Submit large lists of emails for background processing. - **Multiple Input Formats**: Submit data as JSON arrays, tabular CSV/TSV/XLSX uploads, or line-separated text. - **Job Tracking**: Monitor processing status using the returned job ID. ### Example JSON Request: ```json { \"emails\": [ \"first-email@domain.com\", \"second-email@domain.com\" ], \"name\": \"my list of emails\", \"enableAI\": true, \"enableAutoCorrection\": true } ``` ### Authentication & Security - **API Key:** Access requires an API key in the request headers. - **ACL Rules:** Optional IP-based access restrictions for enhanced security. - **No Query Parameters:** All data is transmitted securely through headers or request body. ### Payload Limits - Maximum payload size: 3MB
426
+
427
+ :param batch_analyze_emails_request: (required)
428
+ :type batch_analyze_emails_request: BatchAnalyzeEmailsRequest
429
+ :param _request_timeout: timeout setting for this request. If one
430
+ number provided, it will be total request
431
+ timeout. It can also be a pair (tuple) of
432
+ (connection, read) timeouts.
433
+ :type _request_timeout: int, tuple(int, int), optional
434
+ :param _request_auth: set to override the auth_settings for an a single
435
+ request; this effectively ignores the
436
+ authentication in the spec for a single request.
437
+ :type _request_auth: dict, optional
438
+ :param _content_type: force content-type for the request.
439
+ :type _content_type: str, Optional
440
+ :param _headers: set to override the headers for a single
441
+ request; this effectively ignores the headers
442
+ in the spec for a single request.
443
+ :type _headers: dict, optional
444
+ :param _host_index: set to override the host_index for a single
445
+ request; this effectively ignores the host_index
446
+ in the spec for a single request.
447
+ :type _host_index: int, optional
448
+ :return: Returns the result object.
449
+ """ # noqa: E501
450
+
451
+ _param = self._batch_analyze_emails_serialize(
452
+ batch_analyze_emails_request=batch_analyze_emails_request,
453
+ _request_auth=_request_auth,
454
+ _content_type=_content_type,
455
+ _headers=_headers,
456
+ _host_index=_host_index
457
+ )
458
+
459
+ _response_types_map: Dict[str, Optional[str]] = {
460
+ '202': "BatchAnalyzeEmails202Response",
461
+ '400': "BatchAnalyzeEmails400Response",
462
+ '401': "BatchAnalyzeEmails401Response",
463
+ '402': "BatchAnalyzeEmails402Response",
464
+ '403': "BatchAnalyzeEmails403Response",
465
+ '413': "BatchAnalyzeEmails413Response",
466
+ '429': "BatchAnalyzeEmails429Response",
467
+ '500': "AnalyzeEmail500Response",
468
+ }
469
+ response_data = self.api_client.call_api(
470
+ *_param,
471
+ _request_timeout=_request_timeout
472
+ )
473
+ response_data.read()
474
+ return self.api_client.response_deserialize(
475
+ response_data=response_data,
476
+ response_types_map=_response_types_map,
477
+ )
478
+
479
+
480
+ @validate_call
481
+ def batch_analyze_emails_without_preload_content(
482
+ self,
483
+ batch_analyze_emails_request: BatchAnalyzeEmailsRequest,
484
+ _request_timeout: Union[
485
+ None,
486
+ Annotated[StrictFloat, Field(gt=0)],
487
+ Tuple[
488
+ Annotated[StrictFloat, Field(gt=0)],
489
+ Annotated[StrictFloat, Field(gt=0)]
490
+ ]
491
+ ] = None,
492
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
493
+ _content_type: Optional[StrictStr] = None,
494
+ _headers: Optional[Dict[StrictStr, Any]] = None,
495
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
496
+ ) -> RESTResponseType:
497
+ """Batch Analyze Emails
498
+
499
+ The **Batch Analyze Emails** endpoint enables processing of large volumes of email addresses asynchronously. This endpoint accepts various input formats and returns a job ID for tracking the analysis progress. ### Features: - **Asynchronous Processing**: Submit large lists of emails for background processing. - **Multiple Input Formats**: Submit data as JSON arrays, tabular CSV/TSV/XLSX uploads, or line-separated text. - **Job Tracking**: Monitor processing status using the returned job ID. ### Example JSON Request: ```json { \"emails\": [ \"first-email@domain.com\", \"second-email@domain.com\" ], \"name\": \"my list of emails\", \"enableAI\": true, \"enableAutoCorrection\": true } ``` ### Authentication & Security - **API Key:** Access requires an API key in the request headers. - **ACL Rules:** Optional IP-based access restrictions for enhanced security. - **No Query Parameters:** All data is transmitted securely through headers or request body. ### Payload Limits - Maximum payload size: 3MB
500
+
501
+ :param batch_analyze_emails_request: (required)
502
+ :type batch_analyze_emails_request: BatchAnalyzeEmailsRequest
503
+ :param _request_timeout: timeout setting for this request. If one
504
+ number provided, it will be total request
505
+ timeout. It can also be a pair (tuple) of
506
+ (connection, read) timeouts.
507
+ :type _request_timeout: int, tuple(int, int), optional
508
+ :param _request_auth: set to override the auth_settings for an a single
509
+ request; this effectively ignores the
510
+ authentication in the spec for a single request.
511
+ :type _request_auth: dict, optional
512
+ :param _content_type: force content-type for the request.
513
+ :type _content_type: str, Optional
514
+ :param _headers: set to override the headers for a single
515
+ request; this effectively ignores the headers
516
+ in the spec for a single request.
517
+ :type _headers: dict, optional
518
+ :param _host_index: set to override the host_index for a single
519
+ request; this effectively ignores the host_index
520
+ in the spec for a single request.
521
+ :type _host_index: int, optional
522
+ :return: Returns the result object.
523
+ """ # noqa: E501
524
+
525
+ _param = self._batch_analyze_emails_serialize(
526
+ batch_analyze_emails_request=batch_analyze_emails_request,
527
+ _request_auth=_request_auth,
528
+ _content_type=_content_type,
529
+ _headers=_headers,
530
+ _host_index=_host_index
531
+ )
532
+
533
+ _response_types_map: Dict[str, Optional[str]] = {
534
+ '202': "BatchAnalyzeEmails202Response",
535
+ '400': "BatchAnalyzeEmails400Response",
536
+ '401': "BatchAnalyzeEmails401Response",
537
+ '402': "BatchAnalyzeEmails402Response",
538
+ '403': "BatchAnalyzeEmails403Response",
539
+ '413': "BatchAnalyzeEmails413Response",
540
+ '429': "BatchAnalyzeEmails429Response",
541
+ '500': "AnalyzeEmail500Response",
542
+ }
543
+ response_data = self.api_client.call_api(
544
+ *_param,
545
+ _request_timeout=_request_timeout
546
+ )
547
+ return response_data.response
548
+
549
+
550
+ def _batch_analyze_emails_serialize(
551
+ self,
552
+ batch_analyze_emails_request,
553
+ _request_auth,
554
+ _content_type,
555
+ _headers,
556
+ _host_index,
557
+ ) -> RequestSerialized:
558
+
559
+ _host = None
560
+
561
+ _collection_formats: Dict[str, str] = {
562
+ }
563
+
564
+ _path_params: Dict[str, str] = {}
565
+ _query_params: List[Tuple[str, str]] = []
566
+ _header_params: Dict[str, Optional[str]] = _headers or {}
567
+ _form_params: List[Tuple[str, str]] = []
568
+ _files: Dict[
569
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
570
+ ] = {}
571
+ _body_params: Optional[bytes] = None
572
+
573
+ # process the path parameters
574
+ # process the query parameters
575
+ # process the header parameters
576
+ # process the form parameters
577
+ # process the body parameter
578
+ if batch_analyze_emails_request is not None:
579
+ _body_params = batch_analyze_emails_request
580
+
581
+
582
+ # set the HTTP header `Accept`
583
+ if 'Accept' not in _header_params:
584
+ _header_params['Accept'] = self.api_client.select_header_accept(
585
+ [
586
+ 'application/json'
587
+ ]
588
+ )
589
+
590
+ # set the HTTP header `Content-Type`
591
+ if _content_type:
592
+ _header_params['Content-Type'] = _content_type
593
+ else:
594
+ _default_content_type = (
595
+ self.api_client.select_header_content_type(
596
+ [
597
+ 'application/json',
598
+ 'multipart/form-data',
599
+ 'text/plain'
600
+ ]
601
+ )
602
+ )
603
+ if _default_content_type is not None:
604
+ _header_params['Content-Type'] = _default_content_type
605
+
606
+ # authentication setting
607
+ _auth_settings: List[str] = [
608
+ 'opportifyToken'
609
+ ]
610
+
611
+ return self.api_client.param_serialize(
612
+ method='POST',
613
+ resource_path='/email/batch',
614
+ path_params=_path_params,
615
+ query_params=_query_params,
616
+ header_params=_header_params,
617
+ body=_body_params,
618
+ post_params=_form_params,
619
+ files=_files,
620
+ auth_settings=_auth_settings,
621
+ collection_formats=_collection_formats,
622
+ _host=_host,
623
+ _request_auth=_request_auth
624
+ )
625
+
626
+
627
+
628
+
629
+ @validate_call
630
+ def create_email_batch_export(
631
+ self,
632
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the completed batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". ")],
633
+ export_request: Optional[ExportRequest] = None,
634
+ _request_timeout: Union[
635
+ None,
636
+ Annotated[StrictFloat, Field(gt=0)],
637
+ Tuple[
638
+ Annotated[StrictFloat, Field(gt=0)],
639
+ Annotated[StrictFloat, Field(gt=0)]
640
+ ]
641
+ ] = None,
642
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
643
+ _content_type: Optional[StrictStr] = None,
644
+ _headers: Optional[Dict[StrictStr, Any]] = None,
645
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
646
+ ) -> ExportCreatedResponse:
647
+ """Create Email Batch Export
648
+
649
+ The **Create Email Batch Export** endpoint allows you to request a custom export of completed batch analysis results. You can apply filters, select specific columns, and choose the output format (CSV or JSON). ### Features: - **Format Options**: Export results as CSV or JSON - **Filtering**: Apply filters on any field in the response data - **Column Selection**: Choose specific fields to include in the export - **Async Processing**: Export requests are processed asynchronously ### Filter Syntax: - **String filters**: Exact match, comma-separated values, or arrays - **Numeric filters**: Exact values, arrays, or range objects with `min`/`max` - **Nested fields**: Use dot notation (e.g., `riskReport.score`) ### Example Request: ```json { \"exportType\": \"csv\", \"filters\": { \"isDeliverable\": \"yes\", \"riskReport.score\": { \"min\": 0, \"max\": 400 }, \"emailProvider\": [\"gmail\", \"yahoo\", \"outlook\"] }, \"columns\": [ \"emailAddress\", \"emailProvider\", \"riskReport.score\", \"isDeliverable\" ] } ```
650
+
651
+ :param job_id: The unique identifier of the completed batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". (required)
652
+ :type job_id: str
653
+ :param export_request:
654
+ :type export_request: ExportRequest
655
+ :param _request_timeout: timeout setting for this request. If one
656
+ number provided, it will be total request
657
+ timeout. It can also be a pair (tuple) of
658
+ (connection, read) timeouts.
659
+ :type _request_timeout: int, tuple(int, int), optional
660
+ :param _request_auth: set to override the auth_settings for an a single
661
+ request; this effectively ignores the
662
+ authentication in the spec for a single request.
663
+ :type _request_auth: dict, optional
664
+ :param _content_type: force content-type for the request.
665
+ :type _content_type: str, Optional
666
+ :param _headers: set to override the headers for a single
667
+ request; this effectively ignores the headers
668
+ in the spec for a single request.
669
+ :type _headers: dict, optional
670
+ :param _host_index: set to override the host_index for a single
671
+ request; this effectively ignores the host_index
672
+ in the spec for a single request.
673
+ :type _host_index: int, optional
674
+ :return: Returns the result object.
675
+ """ # noqa: E501
676
+
677
+ _param = self._create_email_batch_export_serialize(
678
+ job_id=job_id,
679
+ export_request=export_request,
680
+ _request_auth=_request_auth,
681
+ _content_type=_content_type,
682
+ _headers=_headers,
683
+ _host_index=_host_index
684
+ )
685
+
686
+ _response_types_map: Dict[str, Optional[str]] = {
687
+ '202': "ExportCreatedResponse",
688
+ '400': "CreateEmailBatchExport400Response",
689
+ '403': "CreateEmailBatchExport403Response",
690
+ '404': "CreateEmailBatchExport404Response",
691
+ '409': "CreateEmailBatchExport409Response",
692
+ }
693
+ response_data = self.api_client.call_api(
694
+ *_param,
695
+ _request_timeout=_request_timeout
696
+ )
697
+ response_data.read()
698
+ return self.api_client.response_deserialize(
699
+ response_data=response_data,
700
+ response_types_map=_response_types_map,
701
+ ).data
702
+
703
+
704
+ @validate_call
705
+ def create_email_batch_export_with_http_info(
706
+ self,
707
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the completed batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". ")],
708
+ export_request: Optional[ExportRequest] = None,
709
+ _request_timeout: Union[
710
+ None,
711
+ Annotated[StrictFloat, Field(gt=0)],
712
+ Tuple[
713
+ Annotated[StrictFloat, Field(gt=0)],
714
+ Annotated[StrictFloat, Field(gt=0)]
715
+ ]
716
+ ] = None,
717
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
718
+ _content_type: Optional[StrictStr] = None,
719
+ _headers: Optional[Dict[StrictStr, Any]] = None,
720
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
721
+ ) -> ApiResponse[ExportCreatedResponse]:
722
+ """Create Email Batch Export
723
+
724
+ The **Create Email Batch Export** endpoint allows you to request a custom export of completed batch analysis results. You can apply filters, select specific columns, and choose the output format (CSV or JSON). ### Features: - **Format Options**: Export results as CSV or JSON - **Filtering**: Apply filters on any field in the response data - **Column Selection**: Choose specific fields to include in the export - **Async Processing**: Export requests are processed asynchronously ### Filter Syntax: - **String filters**: Exact match, comma-separated values, or arrays - **Numeric filters**: Exact values, arrays, or range objects with `min`/`max` - **Nested fields**: Use dot notation (e.g., `riskReport.score`) ### Example Request: ```json { \"exportType\": \"csv\", \"filters\": { \"isDeliverable\": \"yes\", \"riskReport.score\": { \"min\": 0, \"max\": 400 }, \"emailProvider\": [\"gmail\", \"yahoo\", \"outlook\"] }, \"columns\": [ \"emailAddress\", \"emailProvider\", \"riskReport.score\", \"isDeliverable\" ] } ```
725
+
726
+ :param job_id: The unique identifier of the completed batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". (required)
727
+ :type job_id: str
728
+ :param export_request:
729
+ :type export_request: ExportRequest
730
+ :param _request_timeout: timeout setting for this request. If one
731
+ number provided, it will be total request
732
+ timeout. It can also be a pair (tuple) of
733
+ (connection, read) timeouts.
734
+ :type _request_timeout: int, tuple(int, int), optional
735
+ :param _request_auth: set to override the auth_settings for an a single
736
+ request; this effectively ignores the
737
+ authentication in the spec for a single request.
738
+ :type _request_auth: dict, optional
739
+ :param _content_type: force content-type for the request.
740
+ :type _content_type: str, Optional
741
+ :param _headers: set to override the headers for a single
742
+ request; this effectively ignores the headers
743
+ in the spec for a single request.
744
+ :type _headers: dict, optional
745
+ :param _host_index: set to override the host_index for a single
746
+ request; this effectively ignores the host_index
747
+ in the spec for a single request.
748
+ :type _host_index: int, optional
749
+ :return: Returns the result object.
750
+ """ # noqa: E501
751
+
752
+ _param = self._create_email_batch_export_serialize(
753
+ job_id=job_id,
754
+ export_request=export_request,
755
+ _request_auth=_request_auth,
756
+ _content_type=_content_type,
757
+ _headers=_headers,
758
+ _host_index=_host_index
759
+ )
760
+
761
+ _response_types_map: Dict[str, Optional[str]] = {
762
+ '202': "ExportCreatedResponse",
763
+ '400': "CreateEmailBatchExport400Response",
764
+ '403': "CreateEmailBatchExport403Response",
765
+ '404': "CreateEmailBatchExport404Response",
766
+ '409': "CreateEmailBatchExport409Response",
767
+ }
768
+ response_data = self.api_client.call_api(
769
+ *_param,
770
+ _request_timeout=_request_timeout
771
+ )
772
+ response_data.read()
773
+ return self.api_client.response_deserialize(
774
+ response_data=response_data,
775
+ response_types_map=_response_types_map,
776
+ )
777
+
778
+
779
+ @validate_call
780
+ def create_email_batch_export_without_preload_content(
781
+ self,
782
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the completed batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". ")],
783
+ export_request: Optional[ExportRequest] = None,
784
+ _request_timeout: Union[
785
+ None,
786
+ Annotated[StrictFloat, Field(gt=0)],
787
+ Tuple[
788
+ Annotated[StrictFloat, Field(gt=0)],
789
+ Annotated[StrictFloat, Field(gt=0)]
790
+ ]
791
+ ] = None,
792
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
793
+ _content_type: Optional[StrictStr] = None,
794
+ _headers: Optional[Dict[StrictStr, Any]] = None,
795
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
796
+ ) -> RESTResponseType:
797
+ """Create Email Batch Export
798
+
799
+ The **Create Email Batch Export** endpoint allows you to request a custom export of completed batch analysis results. You can apply filters, select specific columns, and choose the output format (CSV or JSON). ### Features: - **Format Options**: Export results as CSV or JSON - **Filtering**: Apply filters on any field in the response data - **Column Selection**: Choose specific fields to include in the export - **Async Processing**: Export requests are processed asynchronously ### Filter Syntax: - **String filters**: Exact match, comma-separated values, or arrays - **Numeric filters**: Exact values, arrays, or range objects with `min`/`max` - **Nested fields**: Use dot notation (e.g., `riskReport.score`) ### Example Request: ```json { \"exportType\": \"csv\", \"filters\": { \"isDeliverable\": \"yes\", \"riskReport.score\": { \"min\": 0, \"max\": 400 }, \"emailProvider\": [\"gmail\", \"yahoo\", \"outlook\"] }, \"columns\": [ \"emailAddress\", \"emailProvider\", \"riskReport.score\", \"isDeliverable\" ] } ```
800
+
801
+ :param job_id: The unique identifier of the completed batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". (required)
802
+ :type job_id: str
803
+ :param export_request:
804
+ :type export_request: ExportRequest
805
+ :param _request_timeout: timeout setting for this request. If one
806
+ number provided, it will be total request
807
+ timeout. It can also be a pair (tuple) of
808
+ (connection, read) timeouts.
809
+ :type _request_timeout: int, tuple(int, int), optional
810
+ :param _request_auth: set to override the auth_settings for an a single
811
+ request; this effectively ignores the
812
+ authentication in the spec for a single request.
813
+ :type _request_auth: dict, optional
814
+ :param _content_type: force content-type for the request.
815
+ :type _content_type: str, Optional
816
+ :param _headers: set to override the headers for a single
817
+ request; this effectively ignores the headers
818
+ in the spec for a single request.
819
+ :type _headers: dict, optional
820
+ :param _host_index: set to override the host_index for a single
821
+ request; this effectively ignores the host_index
822
+ in the spec for a single request.
823
+ :type _host_index: int, optional
824
+ :return: Returns the result object.
825
+ """ # noqa: E501
826
+
827
+ _param = self._create_email_batch_export_serialize(
828
+ job_id=job_id,
829
+ export_request=export_request,
830
+ _request_auth=_request_auth,
831
+ _content_type=_content_type,
832
+ _headers=_headers,
833
+ _host_index=_host_index
834
+ )
835
+
836
+ _response_types_map: Dict[str, Optional[str]] = {
837
+ '202': "ExportCreatedResponse",
838
+ '400': "CreateEmailBatchExport400Response",
839
+ '403': "CreateEmailBatchExport403Response",
840
+ '404': "CreateEmailBatchExport404Response",
841
+ '409': "CreateEmailBatchExport409Response",
842
+ }
843
+ response_data = self.api_client.call_api(
844
+ *_param,
845
+ _request_timeout=_request_timeout
846
+ )
847
+ return response_data.response
848
+
849
+
850
+ def _create_email_batch_export_serialize(
851
+ self,
852
+ job_id,
853
+ export_request,
854
+ _request_auth,
855
+ _content_type,
856
+ _headers,
857
+ _host_index,
858
+ ) -> RequestSerialized:
859
+
860
+ _host = None
861
+
862
+ _collection_formats: Dict[str, str] = {
863
+ }
864
+
865
+ _path_params: Dict[str, str] = {}
866
+ _query_params: List[Tuple[str, str]] = []
867
+ _header_params: Dict[str, Optional[str]] = _headers or {}
868
+ _form_params: List[Tuple[str, str]] = []
869
+ _files: Dict[
870
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
871
+ ] = {}
872
+ _body_params: Optional[bytes] = None
873
+
874
+ # process the path parameters
875
+ if job_id is not None:
876
+ _path_params['jobId'] = job_id
877
+ # process the query parameters
878
+ # process the header parameters
879
+ # process the form parameters
880
+ # process the body parameter
881
+ if export_request is not None:
882
+ _body_params = export_request
883
+
884
+
885
+ # set the HTTP header `Accept`
886
+ if 'Accept' not in _header_params:
887
+ _header_params['Accept'] = self.api_client.select_header_accept(
888
+ [
889
+ 'application/json'
890
+ ]
891
+ )
892
+
893
+ # set the HTTP header `Content-Type`
894
+ if _content_type:
895
+ _header_params['Content-Type'] = _content_type
896
+ else:
897
+ _default_content_type = (
898
+ self.api_client.select_header_content_type(
899
+ [
900
+ 'application/json'
901
+ ]
902
+ )
903
+ )
904
+ if _default_content_type is not None:
905
+ _header_params['Content-Type'] = _default_content_type
906
+
907
+ # authentication setting
908
+ _auth_settings: List[str] = [
909
+ 'opportifyToken'
910
+ ]
911
+
912
+ return self.api_client.param_serialize(
913
+ method='POST',
914
+ resource_path='/email/batch/{jobId}/exports',
915
+ path_params=_path_params,
916
+ query_params=_query_params,
917
+ header_params=_header_params,
918
+ body=_body_params,
919
+ post_params=_form_params,
920
+ files=_files,
921
+ auth_settings=_auth_settings,
922
+ collection_formats=_collection_formats,
923
+ _host=_host,
924
+ _request_auth=_request_auth
925
+ )
926
+
927
+
928
+
929
+
930
+ @validate_call
931
+ def get_email_batch_export_status(
932
+ self,
933
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". ")],
934
+ export_id: Annotated[StrictStr, Field(description="The unique identifier of the export job. Format: uuid. Example: \"6f8d88ef-0896-4f69-90cd-7cc6ce5e6ddf\". ")],
935
+ _request_timeout: Union[
936
+ None,
937
+ Annotated[StrictFloat, Field(gt=0)],
938
+ Tuple[
939
+ Annotated[StrictFloat, Field(gt=0)],
940
+ Annotated[StrictFloat, Field(gt=0)]
941
+ ]
942
+ ] = None,
943
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
944
+ _content_type: Optional[StrictStr] = None,
945
+ _headers: Optional[Dict[StrictStr, Any]] = None,
946
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
947
+ ) -> ExportStatusResponse:
948
+ """Get Email Batch Export Status
949
+
950
+ The **Get Email Batch Export Status** endpoint retrieves the status and download URL for a previously requested export job. ### Export Status Values: - `QUEUED`: Export request received, waiting for processing - `PROCESSING`: Worker is filtering and generating the export file - `COMPLETED`: Export ready, `downloadUrl` available - `FAILED`: Export failed, check `errorCode` and `errorMessage`
951
+
952
+ :param job_id: The unique identifier of the batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". (required)
953
+ :type job_id: str
954
+ :param export_id: The unique identifier of the export job. Format: uuid. Example: \"6f8d88ef-0896-4f69-90cd-7cc6ce5e6ddf\". (required)
955
+ :type export_id: str
956
+ :param _request_timeout: timeout setting for this request. If one
957
+ number provided, it will be total request
958
+ timeout. It can also be a pair (tuple) of
959
+ (connection, read) timeouts.
960
+ :type _request_timeout: int, tuple(int, int), optional
961
+ :param _request_auth: set to override the auth_settings for an a single
962
+ request; this effectively ignores the
963
+ authentication in the spec for a single request.
964
+ :type _request_auth: dict, optional
965
+ :param _content_type: force content-type for the request.
966
+ :type _content_type: str, Optional
967
+ :param _headers: set to override the headers for a single
968
+ request; this effectively ignores the headers
969
+ in the spec for a single request.
970
+ :type _headers: dict, optional
971
+ :param _host_index: set to override the host_index for a single
972
+ request; this effectively ignores the host_index
973
+ in the spec for a single request.
974
+ :type _host_index: int, optional
975
+ :return: Returns the result object.
976
+ """ # noqa: E501
977
+
978
+ _param = self._get_email_batch_export_status_serialize(
979
+ job_id=job_id,
980
+ export_id=export_id,
981
+ _request_auth=_request_auth,
982
+ _content_type=_content_type,
983
+ _headers=_headers,
984
+ _host_index=_host_index
985
+ )
986
+
987
+ _response_types_map: Dict[str, Optional[str]] = {
988
+ '200': "ExportStatusResponse",
989
+ '400': "GetEmailBatchExportStatus400Response",
990
+ '403': "CreateEmailBatchExport403Response",
991
+ '404': "GetEmailBatchExportStatus404Response",
992
+ }
993
+ response_data = self.api_client.call_api(
994
+ *_param,
995
+ _request_timeout=_request_timeout
996
+ )
997
+ response_data.read()
998
+ return self.api_client.response_deserialize(
999
+ response_data=response_data,
1000
+ response_types_map=_response_types_map,
1001
+ ).data
1002
+
1003
+
1004
+ @validate_call
1005
+ def get_email_batch_export_status_with_http_info(
1006
+ self,
1007
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". ")],
1008
+ export_id: Annotated[StrictStr, Field(description="The unique identifier of the export job. Format: uuid. Example: \"6f8d88ef-0896-4f69-90cd-7cc6ce5e6ddf\". ")],
1009
+ _request_timeout: Union[
1010
+ None,
1011
+ Annotated[StrictFloat, Field(gt=0)],
1012
+ Tuple[
1013
+ Annotated[StrictFloat, Field(gt=0)],
1014
+ Annotated[StrictFloat, Field(gt=0)]
1015
+ ]
1016
+ ] = None,
1017
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1018
+ _content_type: Optional[StrictStr] = None,
1019
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1020
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1021
+ ) -> ApiResponse[ExportStatusResponse]:
1022
+ """Get Email Batch Export Status
1023
+
1024
+ The **Get Email Batch Export Status** endpoint retrieves the status and download URL for a previously requested export job. ### Export Status Values: - `QUEUED`: Export request received, waiting for processing - `PROCESSING`: Worker is filtering and generating the export file - `COMPLETED`: Export ready, `downloadUrl` available - `FAILED`: Export failed, check `errorCode` and `errorMessage`
1025
+
1026
+ :param job_id: The unique identifier of the batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". (required)
1027
+ :type job_id: str
1028
+ :param export_id: The unique identifier of the export job. Format: uuid. Example: \"6f8d88ef-0896-4f69-90cd-7cc6ce5e6ddf\". (required)
1029
+ :type export_id: str
1030
+ :param _request_timeout: timeout setting for this request. If one
1031
+ number provided, it will be total request
1032
+ timeout. It can also be a pair (tuple) of
1033
+ (connection, read) timeouts.
1034
+ :type _request_timeout: int, tuple(int, int), optional
1035
+ :param _request_auth: set to override the auth_settings for an a single
1036
+ request; this effectively ignores the
1037
+ authentication in the spec for a single request.
1038
+ :type _request_auth: dict, optional
1039
+ :param _content_type: force content-type for the request.
1040
+ :type _content_type: str, Optional
1041
+ :param _headers: set to override the headers for a single
1042
+ request; this effectively ignores the headers
1043
+ in the spec for a single request.
1044
+ :type _headers: dict, optional
1045
+ :param _host_index: set to override the host_index for a single
1046
+ request; this effectively ignores the host_index
1047
+ in the spec for a single request.
1048
+ :type _host_index: int, optional
1049
+ :return: Returns the result object.
1050
+ """ # noqa: E501
1051
+
1052
+ _param = self._get_email_batch_export_status_serialize(
1053
+ job_id=job_id,
1054
+ export_id=export_id,
1055
+ _request_auth=_request_auth,
1056
+ _content_type=_content_type,
1057
+ _headers=_headers,
1058
+ _host_index=_host_index
1059
+ )
1060
+
1061
+ _response_types_map: Dict[str, Optional[str]] = {
1062
+ '200': "ExportStatusResponse",
1063
+ '400': "GetEmailBatchExportStatus400Response",
1064
+ '403': "CreateEmailBatchExport403Response",
1065
+ '404': "GetEmailBatchExportStatus404Response",
1066
+ }
1067
+ response_data = self.api_client.call_api(
1068
+ *_param,
1069
+ _request_timeout=_request_timeout
1070
+ )
1071
+ response_data.read()
1072
+ return self.api_client.response_deserialize(
1073
+ response_data=response_data,
1074
+ response_types_map=_response_types_map,
1075
+ )
1076
+
1077
+
1078
+ @validate_call
1079
+ def get_email_batch_export_status_without_preload_content(
1080
+ self,
1081
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". ")],
1082
+ export_id: Annotated[StrictStr, Field(description="The unique identifier of the export job. Format: uuid. Example: \"6f8d88ef-0896-4f69-90cd-7cc6ce5e6ddf\". ")],
1083
+ _request_timeout: Union[
1084
+ None,
1085
+ Annotated[StrictFloat, Field(gt=0)],
1086
+ Tuple[
1087
+ Annotated[StrictFloat, Field(gt=0)],
1088
+ Annotated[StrictFloat, Field(gt=0)]
1089
+ ]
1090
+ ] = None,
1091
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1092
+ _content_type: Optional[StrictStr] = None,
1093
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1094
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1095
+ ) -> RESTResponseType:
1096
+ """Get Email Batch Export Status
1097
+
1098
+ The **Get Email Batch Export Status** endpoint retrieves the status and download URL for a previously requested export job. ### Export Status Values: - `QUEUED`: Export request received, waiting for processing - `PROCESSING`: Worker is filtering and generating the export file - `COMPLETED`: Export ready, `downloadUrl` available - `FAILED`: Export failed, check `errorCode` and `errorMessage`
1099
+
1100
+ :param job_id: The unique identifier of the batch job. Format: uuid. Example: \"84d22c8b-2cb6-4606-bfb1-361244a097e4\". (required)
1101
+ :type job_id: str
1102
+ :param export_id: The unique identifier of the export job. Format: uuid. Example: \"6f8d88ef-0896-4f69-90cd-7cc6ce5e6ddf\". (required)
1103
+ :type export_id: str
1104
+ :param _request_timeout: timeout setting for this request. If one
1105
+ number provided, it will be total request
1106
+ timeout. It can also be a pair (tuple) of
1107
+ (connection, read) timeouts.
1108
+ :type _request_timeout: int, tuple(int, int), optional
1109
+ :param _request_auth: set to override the auth_settings for an a single
1110
+ request; this effectively ignores the
1111
+ authentication in the spec for a single request.
1112
+ :type _request_auth: dict, optional
1113
+ :param _content_type: force content-type for the request.
1114
+ :type _content_type: str, Optional
1115
+ :param _headers: set to override the headers for a single
1116
+ request; this effectively ignores the headers
1117
+ in the spec for a single request.
1118
+ :type _headers: dict, optional
1119
+ :param _host_index: set to override the host_index for a single
1120
+ request; this effectively ignores the host_index
1121
+ in the spec for a single request.
1122
+ :type _host_index: int, optional
1123
+ :return: Returns the result object.
1124
+ """ # noqa: E501
1125
+
1126
+ _param = self._get_email_batch_export_status_serialize(
1127
+ job_id=job_id,
1128
+ export_id=export_id,
1129
+ _request_auth=_request_auth,
1130
+ _content_type=_content_type,
1131
+ _headers=_headers,
1132
+ _host_index=_host_index
1133
+ )
1134
+
1135
+ _response_types_map: Dict[str, Optional[str]] = {
1136
+ '200': "ExportStatusResponse",
1137
+ '400': "GetEmailBatchExportStatus400Response",
1138
+ '403': "CreateEmailBatchExport403Response",
1139
+ '404': "GetEmailBatchExportStatus404Response",
1140
+ }
1141
+ response_data = self.api_client.call_api(
1142
+ *_param,
1143
+ _request_timeout=_request_timeout
1144
+ )
1145
+ return response_data.response
1146
+
1147
+
1148
+ def _get_email_batch_export_status_serialize(
1149
+ self,
1150
+ job_id,
1151
+ export_id,
1152
+ _request_auth,
1153
+ _content_type,
1154
+ _headers,
1155
+ _host_index,
1156
+ ) -> RequestSerialized:
1157
+
1158
+ _host = None
1159
+
1160
+ _collection_formats: Dict[str, str] = {
1161
+ }
1162
+
1163
+ _path_params: Dict[str, str] = {}
1164
+ _query_params: List[Tuple[str, str]] = []
1165
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1166
+ _form_params: List[Tuple[str, str]] = []
1167
+ _files: Dict[
1168
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1169
+ ] = {}
1170
+ _body_params: Optional[bytes] = None
1171
+
1172
+ # process the path parameters
1173
+ if job_id is not None:
1174
+ _path_params['jobId'] = job_id
1175
+ if export_id is not None:
1176
+ _path_params['exportId'] = export_id
1177
+ # process the query parameters
1178
+ # process the header parameters
1179
+ # process the form parameters
1180
+ # process the body parameter
1181
+
1182
+
1183
+ # set the HTTP header `Accept`
1184
+ if 'Accept' not in _header_params:
1185
+ _header_params['Accept'] = self.api_client.select_header_accept(
1186
+ [
1187
+ 'application/json'
1188
+ ]
1189
+ )
1190
+
1191
+
1192
+ # authentication setting
1193
+ _auth_settings: List[str] = [
1194
+ 'opportifyToken'
1195
+ ]
1196
+
1197
+ return self.api_client.param_serialize(
1198
+ method='GET',
1199
+ resource_path='/email/batch/{jobId}/exports/{exportId}',
1200
+ path_params=_path_params,
1201
+ query_params=_query_params,
1202
+ header_params=_header_params,
1203
+ body=_body_params,
1204
+ post_params=_form_params,
1205
+ files=_files,
1206
+ auth_settings=_auth_settings,
1207
+ collection_formats=_collection_formats,
1208
+ _host=_host,
1209
+ _request_auth=_request_auth
1210
+ )
1211
+
1212
+
1213
+
1214
+
1215
+ @validate_call
1216
+ def get_email_batch_status(
1217
+ self,
1218
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job to retrieve status for.")],
1219
+ _request_timeout: Union[
1220
+ None,
1221
+ Annotated[StrictFloat, Field(gt=0)],
1222
+ Tuple[
1223
+ Annotated[StrictFloat, Field(gt=0)],
1224
+ Annotated[StrictFloat, Field(gt=0)]
1225
+ ]
1226
+ ] = None,
1227
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1228
+ _content_type: Optional[StrictStr] = None,
1229
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1230
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1231
+ ) -> GetEmailBatchStatus200Response:
1232
+ """Get Email Batch Status
1233
+
1234
+ The **Get Email Batch Status** endpoint allows you to retrieve the current status of a previously submitted batch processing job. Use this endpoint to track the progress of your batch email analysis request and retrieve results when processing is complete. ### Response Information: - When status is `QUEUED`: The job is in the processing queue waiting to be processed. - When status is `PROCESSING`: The job is actively being processed. - When status is `COMPLETED`: The job has finished successfully. - When status is `ERROR`: An issue occurred during processing; check the statusDescription for details.
1235
+
1236
+ :param job_id: The unique identifier of the batch job to retrieve status for. (required)
1237
+ :type job_id: str
1238
+ :param _request_timeout: timeout setting for this request. If one
1239
+ number provided, it will be total request
1240
+ timeout. It can also be a pair (tuple) of
1241
+ (connection, read) timeouts.
1242
+ :type _request_timeout: int, tuple(int, int), optional
1243
+ :param _request_auth: set to override the auth_settings for an a single
1244
+ request; this effectively ignores the
1245
+ authentication in the spec for a single request.
1246
+ :type _request_auth: dict, optional
1247
+ :param _content_type: force content-type for the request.
1248
+ :type _content_type: str, Optional
1249
+ :param _headers: set to override the headers for a single
1250
+ request; this effectively ignores the headers
1251
+ in the spec for a single request.
1252
+ :type _headers: dict, optional
1253
+ :param _host_index: set to override the host_index for a single
1254
+ request; this effectively ignores the host_index
1255
+ in the spec for a single request.
1256
+ :type _host_index: int, optional
1257
+ :return: Returns the result object.
1258
+ """ # noqa: E501
1259
+
1260
+ _param = self._get_email_batch_status_serialize(
1261
+ job_id=job_id,
1262
+ _request_auth=_request_auth,
1263
+ _content_type=_content_type,
1264
+ _headers=_headers,
1265
+ _host_index=_host_index
1266
+ )
1267
+
1268
+ _response_types_map: Dict[str, Optional[str]] = {
1269
+ '200': "GetEmailBatchStatus200Response",
1270
+ '401': "BatchAnalyzeEmails401Response",
1271
+ '402': "BatchAnalyzeEmails402Response",
1272
+ '403': "BatchAnalyzeEmails403Response",
1273
+ '404': "GetEmailBatchStatus404Response",
1274
+ '429': "BatchAnalyzeEmails429Response",
1275
+ '500': "AnalyzeEmail500Response",
1276
+ }
1277
+ response_data = self.api_client.call_api(
1278
+ *_param,
1279
+ _request_timeout=_request_timeout
1280
+ )
1281
+ response_data.read()
1282
+ return self.api_client.response_deserialize(
1283
+ response_data=response_data,
1284
+ response_types_map=_response_types_map,
1285
+ ).data
1286
+
1287
+
1288
+ @validate_call
1289
+ def get_email_batch_status_with_http_info(
1290
+ self,
1291
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job to retrieve status for.")],
1292
+ _request_timeout: Union[
1293
+ None,
1294
+ Annotated[StrictFloat, Field(gt=0)],
1295
+ Tuple[
1296
+ Annotated[StrictFloat, Field(gt=0)],
1297
+ Annotated[StrictFloat, Field(gt=0)]
1298
+ ]
1299
+ ] = None,
1300
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1301
+ _content_type: Optional[StrictStr] = None,
1302
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1303
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1304
+ ) -> ApiResponse[GetEmailBatchStatus200Response]:
1305
+ """Get Email Batch Status
1306
+
1307
+ The **Get Email Batch Status** endpoint allows you to retrieve the current status of a previously submitted batch processing job. Use this endpoint to track the progress of your batch email analysis request and retrieve results when processing is complete. ### Response Information: - When status is `QUEUED`: The job is in the processing queue waiting to be processed. - When status is `PROCESSING`: The job is actively being processed. - When status is `COMPLETED`: The job has finished successfully. - When status is `ERROR`: An issue occurred during processing; check the statusDescription for details.
1308
+
1309
+ :param job_id: The unique identifier of the batch job to retrieve status for. (required)
1310
+ :type job_id: str
1311
+ :param _request_timeout: timeout setting for this request. If one
1312
+ number provided, it will be total request
1313
+ timeout. It can also be a pair (tuple) of
1314
+ (connection, read) timeouts.
1315
+ :type _request_timeout: int, tuple(int, int), optional
1316
+ :param _request_auth: set to override the auth_settings for an a single
1317
+ request; this effectively ignores the
1318
+ authentication in the spec for a single request.
1319
+ :type _request_auth: dict, optional
1320
+ :param _content_type: force content-type for the request.
1321
+ :type _content_type: str, Optional
1322
+ :param _headers: set to override the headers for a single
1323
+ request; this effectively ignores the headers
1324
+ in the spec for a single request.
1325
+ :type _headers: dict, optional
1326
+ :param _host_index: set to override the host_index for a single
1327
+ request; this effectively ignores the host_index
1328
+ in the spec for a single request.
1329
+ :type _host_index: int, optional
1330
+ :return: Returns the result object.
1331
+ """ # noqa: E501
1332
+
1333
+ _param = self._get_email_batch_status_serialize(
1334
+ job_id=job_id,
1335
+ _request_auth=_request_auth,
1336
+ _content_type=_content_type,
1337
+ _headers=_headers,
1338
+ _host_index=_host_index
1339
+ )
1340
+
1341
+ _response_types_map: Dict[str, Optional[str]] = {
1342
+ '200': "GetEmailBatchStatus200Response",
1343
+ '401': "BatchAnalyzeEmails401Response",
1344
+ '402': "BatchAnalyzeEmails402Response",
1345
+ '403': "BatchAnalyzeEmails403Response",
1346
+ '404': "GetEmailBatchStatus404Response",
1347
+ '429': "BatchAnalyzeEmails429Response",
1348
+ '500': "AnalyzeEmail500Response",
1349
+ }
1350
+ response_data = self.api_client.call_api(
1351
+ *_param,
1352
+ _request_timeout=_request_timeout
1353
+ )
1354
+ response_data.read()
1355
+ return self.api_client.response_deserialize(
1356
+ response_data=response_data,
1357
+ response_types_map=_response_types_map,
1358
+ )
1359
+
1360
+
1361
+ @validate_call
1362
+ def get_email_batch_status_without_preload_content(
1363
+ self,
1364
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job to retrieve status for.")],
1365
+ _request_timeout: Union[
1366
+ None,
1367
+ Annotated[StrictFloat, Field(gt=0)],
1368
+ Tuple[
1369
+ Annotated[StrictFloat, Field(gt=0)],
1370
+ Annotated[StrictFloat, Field(gt=0)]
1371
+ ]
1372
+ ] = None,
1373
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1374
+ _content_type: Optional[StrictStr] = None,
1375
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1376
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1377
+ ) -> RESTResponseType:
1378
+ """Get Email Batch Status
1379
+
1380
+ The **Get Email Batch Status** endpoint allows you to retrieve the current status of a previously submitted batch processing job. Use this endpoint to track the progress of your batch email analysis request and retrieve results when processing is complete. ### Response Information: - When status is `QUEUED`: The job is in the processing queue waiting to be processed. - When status is `PROCESSING`: The job is actively being processed. - When status is `COMPLETED`: The job has finished successfully. - When status is `ERROR`: An issue occurred during processing; check the statusDescription for details.
1381
+
1382
+ :param job_id: The unique identifier of the batch job to retrieve status for. (required)
1383
+ :type job_id: str
1384
+ :param _request_timeout: timeout setting for this request. If one
1385
+ number provided, it will be total request
1386
+ timeout. It can also be a pair (tuple) of
1387
+ (connection, read) timeouts.
1388
+ :type _request_timeout: int, tuple(int, int), optional
1389
+ :param _request_auth: set to override the auth_settings for an a single
1390
+ request; this effectively ignores the
1391
+ authentication in the spec for a single request.
1392
+ :type _request_auth: dict, optional
1393
+ :param _content_type: force content-type for the request.
1394
+ :type _content_type: str, Optional
1395
+ :param _headers: set to override the headers for a single
1396
+ request; this effectively ignores the headers
1397
+ in the spec for a single request.
1398
+ :type _headers: dict, optional
1399
+ :param _host_index: set to override the host_index for a single
1400
+ request; this effectively ignores the host_index
1401
+ in the spec for a single request.
1402
+ :type _host_index: int, optional
1403
+ :return: Returns the result object.
1404
+ """ # noqa: E501
1405
+
1406
+ _param = self._get_email_batch_status_serialize(
1407
+ job_id=job_id,
1408
+ _request_auth=_request_auth,
1409
+ _content_type=_content_type,
1410
+ _headers=_headers,
1411
+ _host_index=_host_index
1412
+ )
1413
+
1414
+ _response_types_map: Dict[str, Optional[str]] = {
1415
+ '200': "GetEmailBatchStatus200Response",
1416
+ '401': "BatchAnalyzeEmails401Response",
1417
+ '402': "BatchAnalyzeEmails402Response",
1418
+ '403': "BatchAnalyzeEmails403Response",
1419
+ '404': "GetEmailBatchStatus404Response",
1420
+ '429': "BatchAnalyzeEmails429Response",
1421
+ '500': "AnalyzeEmail500Response",
1422
+ }
1423
+ response_data = self.api_client.call_api(
1424
+ *_param,
1425
+ _request_timeout=_request_timeout
1426
+ )
1427
+ return response_data.response
1428
+
1429
+
1430
+ def _get_email_batch_status_serialize(
1431
+ self,
1432
+ job_id,
1433
+ _request_auth,
1434
+ _content_type,
1435
+ _headers,
1436
+ _host_index,
1437
+ ) -> RequestSerialized:
1438
+
1439
+ _host = None
1440
+
1441
+ _collection_formats: Dict[str, str] = {
1442
+ }
1443
+
1444
+ _path_params: Dict[str, str] = {}
1445
+ _query_params: List[Tuple[str, str]] = []
1446
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1447
+ _form_params: List[Tuple[str, str]] = []
1448
+ _files: Dict[
1449
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1450
+ ] = {}
1451
+ _body_params: Optional[bytes] = None
1452
+
1453
+ # process the path parameters
1454
+ if job_id is not None:
1455
+ _path_params['jobId'] = job_id
1456
+ # process the query parameters
1457
+ # process the header parameters
1458
+ # process the form parameters
1459
+ # process the body parameter
1460
+
1461
+
1462
+ # set the HTTP header `Accept`
1463
+ if 'Accept' not in _header_params:
1464
+ _header_params['Accept'] = self.api_client.select_header_accept(
1465
+ [
1466
+ 'application/json'
1467
+ ]
1468
+ )
1469
+
1470
+
1471
+ # authentication setting
1472
+ _auth_settings: List[str] = [
1473
+ 'opportifyToken'
1474
+ ]
1475
+
1476
+ return self.api_client.param_serialize(
1477
+ method='GET',
1478
+ resource_path='/email/batch/{jobId}',
1479
+ path_params=_path_params,
1480
+ query_params=_query_params,
1481
+ header_params=_header_params,
1482
+ body=_body_params,
1483
+ post_params=_form_params,
1484
+ files=_files,
1485
+ auth_settings=_auth_settings,
1486
+ collection_formats=_collection_formats,
1487
+ _host=_host,
1488
+ _request_auth=_request_auth
1489
+ )
1490
+
1491
+