opportify-sdk 0.1.1__py3-none-any.whl → 0.2.0__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 (79) hide show
  1. openapi_client/__init__.py +86 -0
  2. openapi_client/api/email_insights_api.py +883 -0
  3. openapi_client/api/ip_insights_api.py +886 -0
  4. {lib/v1/openapi_client → openapi_client}/api_client.py +2 -2
  5. {lib/v1/openapi_client → openapi_client}/configuration.py +1 -1
  6. {lib/v1/openapi_client → openapi_client}/exceptions.py +18 -1
  7. openapi_client/models/__init__.py +68 -0
  8. {lib/v1/openapi_client → openapi_client}/models/abuse_contact.py +1 -1
  9. {lib/v1/openapi_client → openapi_client}/models/admin_contact.py +1 -1
  10. {lib/v1/openapi_client → openapi_client}/models/analyze_email200_response.py +9 -7
  11. {lib/v1/openapi_client → openapi_client}/models/analyze_email400_response.py +1 -1
  12. {lib/v1/openapi_client → openapi_client}/models/analyze_email400_response_error.py +1 -1
  13. openapi_client/models/analyze_email403_response.py +91 -0
  14. openapi_client/models/analyze_email403_response_error.py +137 -0
  15. {lib/v1/openapi_client → openapi_client}/models/analyze_email500_response.py +1 -1
  16. {lib/v1/openapi_client → openapi_client}/models/analyze_email500_response_error.py +1 -1
  17. {lib/v1/openapi_client → openapi_client}/models/analyze_email_request.py +1 -1
  18. {lib/v1/openapi_client → openapi_client}/models/analyze_ip200_response.py +4 -4
  19. {lib/v1/openapi_client → openapi_client}/models/analyze_ip400_response.py +1 -1
  20. {lib/v1/openapi_client → openapi_client}/models/analyze_ip400_response_error.py +1 -1
  21. {lib/v1/openapi_client → openapi_client}/models/analyze_ip404_response.py +1 -1
  22. {lib/v1/openapi_client → openapi_client}/models/analyze_ip500_response.py +1 -1
  23. {lib/v1/openapi_client → openapi_client}/models/analyze_ip_request.py +1 -1
  24. {lib/v1/openapi_client → openapi_client}/models/asn.py +1 -1
  25. openapi_client/models/batch_analyze_emails202_response.py +101 -0
  26. openapi_client/models/batch_analyze_emails400_response.py +91 -0
  27. openapi_client/models/batch_analyze_emails400_response_error.py +137 -0
  28. openapi_client/models/batch_analyze_emails403_response.py +91 -0
  29. openapi_client/models/batch_analyze_emails403_response_error.py +89 -0
  30. openapi_client/models/batch_analyze_emails413_response.py +91 -0
  31. openapi_client/models/batch_analyze_emails413_response_error.py +89 -0
  32. openapi_client/models/batch_analyze_emails_request.py +91 -0
  33. openapi_client/models/batch_analyze_ips400_response.py +91 -0
  34. openapi_client/models/batch_analyze_ips400_response_error.py +137 -0
  35. openapi_client/models/batch_analyze_ips_request.py +89 -0
  36. {lib/v1/openapi_client → openapi_client}/models/block_listed.py +1 -1
  37. {lib/v1/openapi_client → openapi_client}/models/email_dns.py +1 -1
  38. {lib/v1/openapi_client → openapi_client}/models/geo.py +1 -1
  39. openapi_client/models/get_email_batch_status200_response.py +109 -0
  40. openapi_client/models/get_email_batch_status200_response_download_urls.py +93 -0
  41. openapi_client/models/get_email_batch_status404_response.py +91 -0
  42. openapi_client/models/get_email_batch_status404_response_error.py +89 -0
  43. {lib/v1/openapi_client → openapi_client}/models/internalerror.py +1 -1
  44. openapi_client/models/invaliddata.py +89 -0
  45. openapi_client/models/invaliddata1.py +89 -0
  46. {lib/v1/openapi_client → openapi_client}/models/invalidemail.py +1 -1
  47. openapi_client/models/invalidplan.py +89 -0
  48. openapi_client/models/invalidtoken.py +89 -0
  49. {lib/v1/openapi_client → openapi_client}/models/ipvalidationfailed.py +1 -1
  50. {lib/v1/openapi_client → openapi_client}/models/malformedrequest.py +1 -1
  51. {lib/v1/openapi_client → openapi_client}/models/malformedrequest1.py +1 -1
  52. openapi_client/models/malformedrequest2.py +89 -0
  53. {lib/v1/openapi_client → openapi_client}/models/notfound.py +1 -1
  54. {lib/v1/openapi_client → openapi_client}/models/organization.py +1 -1
  55. openapi_client/models/risk_report_email.py +91 -0
  56. lib/v1/openapi_client/models/risk_report.py → openapi_client/models/risk_report_ip.py +4 -4
  57. {lib/v1/openapi_client → openapi_client}/models/tech_contact.py +1 -1
  58. {lib/v1/openapi_client → openapi_client}/models/trusted_provider.py +1 -1
  59. {lib/v1/openapi_client → openapi_client}/models/whois.py +1 -1
  60. {lib/v1/openapi_client → openapi_client}/rest.py +1 -1
  61. {src → opportify_sdk}/email_insights.py +79 -0
  62. {src → opportify_sdk}/ip_insights.py +75 -1
  63. opportify_sdk-0.2.0.dist-info/METADATA +239 -0
  64. opportify_sdk-0.2.0.dist-info/RECORD +70 -0
  65. {opportify_sdk-0.1.1.dist-info → opportify_sdk-0.2.0.dist-info}/WHEEL +1 -1
  66. opportify_sdk-0.2.0.dist-info/top_level.txt +2 -0
  67. lib/__init__.py +0 -0
  68. lib/v1/__init__.py +0 -0
  69. lib/v1/openapi_client/__init__.py +0 -63
  70. lib/v1/openapi_client/api/email_insights_api.py +0 -317
  71. lib/v1/openapi_client/api/ip_insights_api.py +0 -322
  72. lib/v1/openapi_client/models/__init__.py +0 -45
  73. opportify_sdk-0.1.1.dist-info/METADATA +0 -108
  74. opportify_sdk-0.1.1.dist-info/RECORD +0 -49
  75. opportify_sdk-0.1.1.dist-info/top_level.txt +0 -2
  76. {lib/v1/openapi_client → openapi_client}/api/__init__.py +0 -0
  77. {lib/v1/openapi_client → openapi_client}/api_response.py +0 -0
  78. {lib/v1/openapi_client → openapi_client}/py.typed +0 -0
  79. {src → opportify_sdk}/__init__.py +0 -0
@@ -0,0 +1,886 @@
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_extensions import Annotated
21
+ from openapi_client.models.analyze_ip200_response import AnalyzeIp200Response
22
+ from openapi_client.models.analyze_ip_request import AnalyzeIpRequest
23
+ from openapi_client.models.batch_analyze_emails202_response import BatchAnalyzeEmails202Response
24
+ from openapi_client.models.batch_analyze_ips_request import BatchAnalyzeIpsRequest
25
+ from openapi_client.models.get_email_batch_status200_response import GetEmailBatchStatus200Response
26
+
27
+ from openapi_client.api_client import ApiClient, RequestSerialized
28
+ from openapi_client.api_response import ApiResponse
29
+ from openapi_client.rest import RESTResponseType
30
+
31
+
32
+ class IPInsightsApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def analyze_ip(
47
+ self,
48
+ analyze_ip_request: AnalyzeIpRequest,
49
+ _request_timeout: Union[
50
+ None,
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Tuple[
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Annotated[StrictFloat, Field(gt=0)]
55
+ ]
56
+ ] = None,
57
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
58
+ _content_type: Optional[StrictStr] = None,
59
+ _headers: Optional[Dict[StrictStr, Any]] = None,
60
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
61
+ ) -> AnalyzeIp200Response:
62
+ """Analyze IP
63
+
64
+ The **Analyze IP** endpoint provides comprehensive insights into a specified IP address, leveraging AI-driven analysis to deliver actionable intelligence. This includes connection type identification, detailed geolocation data, WHOIS information, trusted provider verification, up-to-date blocklist reports, and a robust risk assessment. Compatible with both IPv4 and IPv6, this endpoint is designed to empower businesses with precise and reliable IP data. ### Features: - 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. ### Example Request Body: ```json { \"ip\": \"192.168.0.1\", \"enableAI\": 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.
65
+
66
+ :param analyze_ip_request: (required)
67
+ :type analyze_ip_request: AnalyzeIpRequest
68
+ :param _request_timeout: timeout setting for this request. If one
69
+ number provided, it will be total request
70
+ timeout. It can also be a pair (tuple) of
71
+ (connection, read) timeouts.
72
+ :type _request_timeout: int, tuple(int, int), optional
73
+ :param _request_auth: set to override the auth_settings for an a single
74
+ request; this effectively ignores the
75
+ authentication in the spec for a single request.
76
+ :type _request_auth: dict, optional
77
+ :param _content_type: force content-type for the request.
78
+ :type _content_type: str, Optional
79
+ :param _headers: set to override the headers for a single
80
+ request; this effectively ignores the headers
81
+ in the spec for a single request.
82
+ :type _headers: dict, optional
83
+ :param _host_index: set to override the host_index for a single
84
+ request; this effectively ignores the host_index
85
+ in the spec for a single request.
86
+ :type _host_index: int, optional
87
+ :return: Returns the result object.
88
+ """ # noqa: E501
89
+
90
+ _param = self._analyze_ip_serialize(
91
+ analyze_ip_request=analyze_ip_request,
92
+ _request_auth=_request_auth,
93
+ _content_type=_content_type,
94
+ _headers=_headers,
95
+ _host_index=_host_index
96
+ )
97
+
98
+ _response_types_map: Dict[str, Optional[str]] = {
99
+ '200': "AnalyzeIp200Response",
100
+ '400': "AnalyzeIp400Response",
101
+ '404': "AnalyzeIp404Response",
102
+ '403': "AnalyzeEmail403Response",
103
+ '500': "AnalyzeIp500Response",
104
+ }
105
+ response_data = self.api_client.call_api(
106
+ *_param,
107
+ _request_timeout=_request_timeout
108
+ )
109
+ response_data.read()
110
+ return self.api_client.response_deserialize(
111
+ response_data=response_data,
112
+ response_types_map=_response_types_map,
113
+ ).data
114
+
115
+
116
+ @validate_call
117
+ def analyze_ip_with_http_info(
118
+ self,
119
+ analyze_ip_request: AnalyzeIpRequest,
120
+ _request_timeout: Union[
121
+ None,
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Tuple[
124
+ Annotated[StrictFloat, Field(gt=0)],
125
+ Annotated[StrictFloat, Field(gt=0)]
126
+ ]
127
+ ] = None,
128
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
129
+ _content_type: Optional[StrictStr] = None,
130
+ _headers: Optional[Dict[StrictStr, Any]] = None,
131
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
132
+ ) -> ApiResponse[AnalyzeIp200Response]:
133
+ """Analyze IP
134
+
135
+ The **Analyze IP** endpoint provides comprehensive insights into a specified IP address, leveraging AI-driven analysis to deliver actionable intelligence. This includes connection type identification, detailed geolocation data, WHOIS information, trusted provider verification, up-to-date blocklist reports, and a robust risk assessment. Compatible with both IPv4 and IPv6, this endpoint is designed to empower businesses with precise and reliable IP data. ### Features: - 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. ### Example Request Body: ```json { \"ip\": \"192.168.0.1\", \"enableAI\": 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.
136
+
137
+ :param analyze_ip_request: (required)
138
+ :type analyze_ip_request: AnalyzeIpRequest
139
+ :param _request_timeout: timeout setting for this request. If one
140
+ number provided, it will be total request
141
+ timeout. It can also be a pair (tuple) of
142
+ (connection, read) timeouts.
143
+ :type _request_timeout: int, tuple(int, int), optional
144
+ :param _request_auth: set to override the auth_settings for an a single
145
+ request; this effectively ignores the
146
+ authentication in the spec for a single request.
147
+ :type _request_auth: dict, optional
148
+ :param _content_type: force content-type for the request.
149
+ :type _content_type: str, Optional
150
+ :param _headers: set to override the headers for a single
151
+ request; this effectively ignores the headers
152
+ in the spec for a single request.
153
+ :type _headers: dict, optional
154
+ :param _host_index: set to override the host_index for a single
155
+ request; this effectively ignores the host_index
156
+ in the spec for a single request.
157
+ :type _host_index: int, optional
158
+ :return: Returns the result object.
159
+ """ # noqa: E501
160
+
161
+ _param = self._analyze_ip_serialize(
162
+ analyze_ip_request=analyze_ip_request,
163
+ _request_auth=_request_auth,
164
+ _content_type=_content_type,
165
+ _headers=_headers,
166
+ _host_index=_host_index
167
+ )
168
+
169
+ _response_types_map: Dict[str, Optional[str]] = {
170
+ '200': "AnalyzeIp200Response",
171
+ '400': "AnalyzeIp400Response",
172
+ '404': "AnalyzeIp404Response",
173
+ '403': "AnalyzeEmail403Response",
174
+ '500': "AnalyzeIp500Response",
175
+ }
176
+ response_data = self.api_client.call_api(
177
+ *_param,
178
+ _request_timeout=_request_timeout
179
+ )
180
+ response_data.read()
181
+ return self.api_client.response_deserialize(
182
+ response_data=response_data,
183
+ response_types_map=_response_types_map,
184
+ )
185
+
186
+
187
+ @validate_call
188
+ def analyze_ip_without_preload_content(
189
+ self,
190
+ analyze_ip_request: AnalyzeIpRequest,
191
+ _request_timeout: Union[
192
+ None,
193
+ Annotated[StrictFloat, Field(gt=0)],
194
+ Tuple[
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Annotated[StrictFloat, Field(gt=0)]
197
+ ]
198
+ ] = None,
199
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
200
+ _content_type: Optional[StrictStr] = None,
201
+ _headers: Optional[Dict[StrictStr, Any]] = None,
202
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
203
+ ) -> RESTResponseType:
204
+ """Analyze IP
205
+
206
+ The **Analyze IP** endpoint provides comprehensive insights into a specified IP address, leveraging AI-driven analysis to deliver actionable intelligence. This includes connection type identification, detailed geolocation data, WHOIS information, trusted provider verification, up-to-date blocklist reports, and a robust risk assessment. Compatible with both IPv4 and IPv6, this endpoint is designed to empower businesses with precise and reliable IP data. ### Features: - 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. ### Example Request Body: ```json { \"ip\": \"192.168.0.1\", \"enableAI\": 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.
207
+
208
+ :param analyze_ip_request: (required)
209
+ :type analyze_ip_request: AnalyzeIpRequest
210
+ :param _request_timeout: timeout setting for this request. If one
211
+ number provided, it will be total request
212
+ timeout. It can also be a pair (tuple) of
213
+ (connection, read) timeouts.
214
+ :type _request_timeout: int, tuple(int, int), optional
215
+ :param _request_auth: set to override the auth_settings for an a single
216
+ request; this effectively ignores the
217
+ authentication in the spec for a single request.
218
+ :type _request_auth: dict, optional
219
+ :param _content_type: force content-type for the request.
220
+ :type _content_type: str, Optional
221
+ :param _headers: set to override the headers for a single
222
+ request; this effectively ignores the headers
223
+ in the spec for a single request.
224
+ :type _headers: dict, optional
225
+ :param _host_index: set to override the host_index for a single
226
+ request; this effectively ignores the host_index
227
+ in the spec for a single request.
228
+ :type _host_index: int, optional
229
+ :return: Returns the result object.
230
+ """ # noqa: E501
231
+
232
+ _param = self._analyze_ip_serialize(
233
+ analyze_ip_request=analyze_ip_request,
234
+ _request_auth=_request_auth,
235
+ _content_type=_content_type,
236
+ _headers=_headers,
237
+ _host_index=_host_index
238
+ )
239
+
240
+ _response_types_map: Dict[str, Optional[str]] = {
241
+ '200': "AnalyzeIp200Response",
242
+ '400': "AnalyzeIp400Response",
243
+ '404': "AnalyzeIp404Response",
244
+ '403': "AnalyzeEmail403Response",
245
+ '500': "AnalyzeIp500Response",
246
+ }
247
+ response_data = self.api_client.call_api(
248
+ *_param,
249
+ _request_timeout=_request_timeout
250
+ )
251
+ return response_data.response
252
+
253
+
254
+ def _analyze_ip_serialize(
255
+ self,
256
+ analyze_ip_request,
257
+ _request_auth,
258
+ _content_type,
259
+ _headers,
260
+ _host_index,
261
+ ) -> RequestSerialized:
262
+
263
+ _host = None
264
+
265
+ _collection_formats: Dict[str, str] = {
266
+ }
267
+
268
+ _path_params: Dict[str, str] = {}
269
+ _query_params: List[Tuple[str, str]] = []
270
+ _header_params: Dict[str, Optional[str]] = _headers or {}
271
+ _form_params: List[Tuple[str, str]] = []
272
+ _files: Dict[
273
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
274
+ ] = {}
275
+ _body_params: Optional[bytes] = None
276
+
277
+ # process the path parameters
278
+ # process the query parameters
279
+ # process the header parameters
280
+ # process the form parameters
281
+ # process the body parameter
282
+ if analyze_ip_request is not None:
283
+ _body_params = analyze_ip_request
284
+
285
+
286
+ # set the HTTP header `Accept`
287
+ if 'Accept' not in _header_params:
288
+ _header_params['Accept'] = self.api_client.select_header_accept(
289
+ [
290
+ 'application/json'
291
+ ]
292
+ )
293
+
294
+ # set the HTTP header `Content-Type`
295
+ if _content_type:
296
+ _header_params['Content-Type'] = _content_type
297
+ else:
298
+ _default_content_type = (
299
+ self.api_client.select_header_content_type(
300
+ [
301
+ 'application/json'
302
+ ]
303
+ )
304
+ )
305
+ if _default_content_type is not None:
306
+ _header_params['Content-Type'] = _default_content_type
307
+
308
+ # authentication setting
309
+ _auth_settings: List[str] = [
310
+ 'opportifyToken'
311
+ ]
312
+
313
+ return self.api_client.param_serialize(
314
+ method='POST',
315
+ resource_path='/ip/analyze',
316
+ path_params=_path_params,
317
+ query_params=_query_params,
318
+ header_params=_header_params,
319
+ body=_body_params,
320
+ post_params=_form_params,
321
+ files=_files,
322
+ auth_settings=_auth_settings,
323
+ collection_formats=_collection_formats,
324
+ _host=_host,
325
+ _request_auth=_request_auth
326
+ )
327
+
328
+
329
+
330
+
331
+ @validate_call
332
+ def batch_analyze_ips(
333
+ self,
334
+ batch_analyze_ips_request: BatchAnalyzeIpsRequest,
335
+ _request_timeout: Union[
336
+ None,
337
+ Annotated[StrictFloat, Field(gt=0)],
338
+ Tuple[
339
+ Annotated[StrictFloat, Field(gt=0)],
340
+ Annotated[StrictFloat, Field(gt=0)]
341
+ ]
342
+ ] = None,
343
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
344
+ _content_type: Optional[StrictStr] = None,
345
+ _headers: Optional[Dict[StrictStr, Any]] = None,
346
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
347
+ ) -> BatchAnalyzeEmails202Response:
348
+ """Batch Analyze IPs
349
+
350
+ The **Batch Analyze IPs** endpoint enables processing of large volumes of IP 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 IP addresses for background processing. - **Multiple Input Formats**: Submit data as JSON arrays, CSV files, or line-separated text. - **Job Tracking**: Monitor processing status using the returned job ID. ### Input Formats: - **JSON Array**: Submit a JSON object containing an array of IP addresses. - **CSV Upload**: Upload a CSV file with IP addresses in a single column (with header row). - **Line-Separated Text**: Submit a plain text file with one IP address per line. ### Example JSON Request: ```json { \"ips\": [ \"192.168.0.1\", \"10.0.0.1\", \"172.16.0.1\" ] } ``` ### 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
351
+
352
+ :param batch_analyze_ips_request: (required)
353
+ :type batch_analyze_ips_request: BatchAnalyzeIpsRequest
354
+ :param _request_timeout: timeout setting for this request. If one
355
+ number provided, it will be total request
356
+ timeout. It can also be a pair (tuple) of
357
+ (connection, read) timeouts.
358
+ :type _request_timeout: int, tuple(int, int), optional
359
+ :param _request_auth: set to override the auth_settings for an a single
360
+ request; this effectively ignores the
361
+ authentication in the spec for a single request.
362
+ :type _request_auth: dict, optional
363
+ :param _content_type: force content-type for the request.
364
+ :type _content_type: str, Optional
365
+ :param _headers: set to override the headers for a single
366
+ request; this effectively ignores the headers
367
+ in the spec for a single request.
368
+ :type _headers: dict, optional
369
+ :param _host_index: set to override the host_index for a single
370
+ request; this effectively ignores the host_index
371
+ in the spec for a single request.
372
+ :type _host_index: int, optional
373
+ :return: Returns the result object.
374
+ """ # noqa: E501
375
+
376
+ _param = self._batch_analyze_ips_serialize(
377
+ batch_analyze_ips_request=batch_analyze_ips_request,
378
+ _request_auth=_request_auth,
379
+ _content_type=_content_type,
380
+ _headers=_headers,
381
+ _host_index=_host_index
382
+ )
383
+
384
+ _response_types_map: Dict[str, Optional[str]] = {
385
+ '202': "BatchAnalyzeEmails202Response",
386
+ '400': "BatchAnalyzeIps400Response",
387
+ '413': "BatchAnalyzeEmails413Response",
388
+ '403': "BatchAnalyzeEmails403Response",
389
+ '500': "AnalyzeEmail500Response",
390
+ }
391
+ response_data = self.api_client.call_api(
392
+ *_param,
393
+ _request_timeout=_request_timeout
394
+ )
395
+ response_data.read()
396
+ return self.api_client.response_deserialize(
397
+ response_data=response_data,
398
+ response_types_map=_response_types_map,
399
+ ).data
400
+
401
+
402
+ @validate_call
403
+ def batch_analyze_ips_with_http_info(
404
+ self,
405
+ batch_analyze_ips_request: BatchAnalyzeIpsRequest,
406
+ _request_timeout: Union[
407
+ None,
408
+ Annotated[StrictFloat, Field(gt=0)],
409
+ Tuple[
410
+ Annotated[StrictFloat, Field(gt=0)],
411
+ Annotated[StrictFloat, Field(gt=0)]
412
+ ]
413
+ ] = None,
414
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
415
+ _content_type: Optional[StrictStr] = None,
416
+ _headers: Optional[Dict[StrictStr, Any]] = None,
417
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
418
+ ) -> ApiResponse[BatchAnalyzeEmails202Response]:
419
+ """Batch Analyze IPs
420
+
421
+ The **Batch Analyze IPs** endpoint enables processing of large volumes of IP 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 IP addresses for background processing. - **Multiple Input Formats**: Submit data as JSON arrays, CSV files, or line-separated text. - **Job Tracking**: Monitor processing status using the returned job ID. ### Input Formats: - **JSON Array**: Submit a JSON object containing an array of IP addresses. - **CSV Upload**: Upload a CSV file with IP addresses in a single column (with header row). - **Line-Separated Text**: Submit a plain text file with one IP address per line. ### Example JSON Request: ```json { \"ips\": [ \"192.168.0.1\", \"10.0.0.1\", \"172.16.0.1\" ] } ``` ### 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
422
+
423
+ :param batch_analyze_ips_request: (required)
424
+ :type batch_analyze_ips_request: BatchAnalyzeIpsRequest
425
+ :param _request_timeout: timeout setting for this request. If one
426
+ number provided, it will be total request
427
+ timeout. It can also be a pair (tuple) of
428
+ (connection, read) timeouts.
429
+ :type _request_timeout: int, tuple(int, int), optional
430
+ :param _request_auth: set to override the auth_settings for an a single
431
+ request; this effectively ignores the
432
+ authentication in the spec for a single request.
433
+ :type _request_auth: dict, optional
434
+ :param _content_type: force content-type for the request.
435
+ :type _content_type: str, Optional
436
+ :param _headers: set to override the headers for a single
437
+ request; this effectively ignores the headers
438
+ in the spec for a single request.
439
+ :type _headers: dict, optional
440
+ :param _host_index: set to override the host_index for a single
441
+ request; this effectively ignores the host_index
442
+ in the spec for a single request.
443
+ :type _host_index: int, optional
444
+ :return: Returns the result object.
445
+ """ # noqa: E501
446
+
447
+ _param = self._batch_analyze_ips_serialize(
448
+ batch_analyze_ips_request=batch_analyze_ips_request,
449
+ _request_auth=_request_auth,
450
+ _content_type=_content_type,
451
+ _headers=_headers,
452
+ _host_index=_host_index
453
+ )
454
+
455
+ _response_types_map: Dict[str, Optional[str]] = {
456
+ '202': "BatchAnalyzeEmails202Response",
457
+ '400': "BatchAnalyzeIps400Response",
458
+ '413': "BatchAnalyzeEmails413Response",
459
+ '403': "BatchAnalyzeEmails403Response",
460
+ '500': "AnalyzeEmail500Response",
461
+ }
462
+ response_data = self.api_client.call_api(
463
+ *_param,
464
+ _request_timeout=_request_timeout
465
+ )
466
+ response_data.read()
467
+ return self.api_client.response_deserialize(
468
+ response_data=response_data,
469
+ response_types_map=_response_types_map,
470
+ )
471
+
472
+
473
+ @validate_call
474
+ def batch_analyze_ips_without_preload_content(
475
+ self,
476
+ batch_analyze_ips_request: BatchAnalyzeIpsRequest,
477
+ _request_timeout: Union[
478
+ None,
479
+ Annotated[StrictFloat, Field(gt=0)],
480
+ Tuple[
481
+ Annotated[StrictFloat, Field(gt=0)],
482
+ Annotated[StrictFloat, Field(gt=0)]
483
+ ]
484
+ ] = None,
485
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
486
+ _content_type: Optional[StrictStr] = None,
487
+ _headers: Optional[Dict[StrictStr, Any]] = None,
488
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
489
+ ) -> RESTResponseType:
490
+ """Batch Analyze IPs
491
+
492
+ The **Batch Analyze IPs** endpoint enables processing of large volumes of IP 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 IP addresses for background processing. - **Multiple Input Formats**: Submit data as JSON arrays, CSV files, or line-separated text. - **Job Tracking**: Monitor processing status using the returned job ID. ### Input Formats: - **JSON Array**: Submit a JSON object containing an array of IP addresses. - **CSV Upload**: Upload a CSV file with IP addresses in a single column (with header row). - **Line-Separated Text**: Submit a plain text file with one IP address per line. ### Example JSON Request: ```json { \"ips\": [ \"192.168.0.1\", \"10.0.0.1\", \"172.16.0.1\" ] } ``` ### 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
493
+
494
+ :param batch_analyze_ips_request: (required)
495
+ :type batch_analyze_ips_request: BatchAnalyzeIpsRequest
496
+ :param _request_timeout: timeout setting for this request. If one
497
+ number provided, it will be total request
498
+ timeout. It can also be a pair (tuple) of
499
+ (connection, read) timeouts.
500
+ :type _request_timeout: int, tuple(int, int), optional
501
+ :param _request_auth: set to override the auth_settings for an a single
502
+ request; this effectively ignores the
503
+ authentication in the spec for a single request.
504
+ :type _request_auth: dict, optional
505
+ :param _content_type: force content-type for the request.
506
+ :type _content_type: str, Optional
507
+ :param _headers: set to override the headers for a single
508
+ request; this effectively ignores the headers
509
+ in the spec for a single request.
510
+ :type _headers: dict, optional
511
+ :param _host_index: set to override the host_index for a single
512
+ request; this effectively ignores the host_index
513
+ in the spec for a single request.
514
+ :type _host_index: int, optional
515
+ :return: Returns the result object.
516
+ """ # noqa: E501
517
+
518
+ _param = self._batch_analyze_ips_serialize(
519
+ batch_analyze_ips_request=batch_analyze_ips_request,
520
+ _request_auth=_request_auth,
521
+ _content_type=_content_type,
522
+ _headers=_headers,
523
+ _host_index=_host_index
524
+ )
525
+
526
+ _response_types_map: Dict[str, Optional[str]] = {
527
+ '202': "BatchAnalyzeEmails202Response",
528
+ '400': "BatchAnalyzeIps400Response",
529
+ '413': "BatchAnalyzeEmails413Response",
530
+ '403': "BatchAnalyzeEmails403Response",
531
+ '500': "AnalyzeEmail500Response",
532
+ }
533
+ response_data = self.api_client.call_api(
534
+ *_param,
535
+ _request_timeout=_request_timeout
536
+ )
537
+ return response_data.response
538
+
539
+
540
+ def _batch_analyze_ips_serialize(
541
+ self,
542
+ batch_analyze_ips_request,
543
+ _request_auth,
544
+ _content_type,
545
+ _headers,
546
+ _host_index,
547
+ ) -> RequestSerialized:
548
+
549
+ _host = None
550
+
551
+ _collection_formats: Dict[str, str] = {
552
+ }
553
+
554
+ _path_params: Dict[str, str] = {}
555
+ _query_params: List[Tuple[str, str]] = []
556
+ _header_params: Dict[str, Optional[str]] = _headers or {}
557
+ _form_params: List[Tuple[str, str]] = []
558
+ _files: Dict[
559
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
560
+ ] = {}
561
+ _body_params: Optional[bytes] = None
562
+
563
+ # process the path parameters
564
+ # process the query parameters
565
+ # process the header parameters
566
+ # process the form parameters
567
+ # process the body parameter
568
+ if batch_analyze_ips_request is not None:
569
+ _body_params = batch_analyze_ips_request
570
+
571
+
572
+ # set the HTTP header `Accept`
573
+ if 'Accept' not in _header_params:
574
+ _header_params['Accept'] = self.api_client.select_header_accept(
575
+ [
576
+ 'application/json'
577
+ ]
578
+ )
579
+
580
+ # set the HTTP header `Content-Type`
581
+ if _content_type:
582
+ _header_params['Content-Type'] = _content_type
583
+ else:
584
+ _default_content_type = (
585
+ self.api_client.select_header_content_type(
586
+ [
587
+ 'application/json',
588
+ 'multipart/form-data',
589
+ 'text/plain'
590
+ ]
591
+ )
592
+ )
593
+ if _default_content_type is not None:
594
+ _header_params['Content-Type'] = _default_content_type
595
+
596
+ # authentication setting
597
+ _auth_settings: List[str] = [
598
+ 'opportifyToken'
599
+ ]
600
+
601
+ return self.api_client.param_serialize(
602
+ method='POST',
603
+ resource_path='/ip/batch',
604
+ path_params=_path_params,
605
+ query_params=_query_params,
606
+ header_params=_header_params,
607
+ body=_body_params,
608
+ post_params=_form_params,
609
+ files=_files,
610
+ auth_settings=_auth_settings,
611
+ collection_formats=_collection_formats,
612
+ _host=_host,
613
+ _request_auth=_request_auth
614
+ )
615
+
616
+
617
+
618
+
619
+ @validate_call
620
+ def get_ip_batch_status(
621
+ self,
622
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job to retrieve status for.")],
623
+ _request_timeout: Union[
624
+ None,
625
+ Annotated[StrictFloat, Field(gt=0)],
626
+ Tuple[
627
+ Annotated[StrictFloat, Field(gt=0)],
628
+ Annotated[StrictFloat, Field(gt=0)]
629
+ ]
630
+ ] = None,
631
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
632
+ _content_type: Optional[StrictStr] = None,
633
+ _headers: Optional[Dict[StrictStr, Any]] = None,
634
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
635
+ ) -> GetEmailBatchStatus200Response:
636
+ """Get IP Batch Status
637
+
638
+ The **Get IP 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 IP 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.
639
+
640
+ :param job_id: The unique identifier of the batch job to retrieve status for. (required)
641
+ :type job_id: str
642
+ :param _request_timeout: timeout setting for this request. If one
643
+ number provided, it will be total request
644
+ timeout. It can also be a pair (tuple) of
645
+ (connection, read) timeouts.
646
+ :type _request_timeout: int, tuple(int, int), optional
647
+ :param _request_auth: set to override the auth_settings for an a single
648
+ request; this effectively ignores the
649
+ authentication in the spec for a single request.
650
+ :type _request_auth: dict, optional
651
+ :param _content_type: force content-type for the request.
652
+ :type _content_type: str, Optional
653
+ :param _headers: set to override the headers for a single
654
+ request; this effectively ignores the headers
655
+ in the spec for a single request.
656
+ :type _headers: dict, optional
657
+ :param _host_index: set to override the host_index for a single
658
+ request; this effectively ignores the host_index
659
+ in the spec for a single request.
660
+ :type _host_index: int, optional
661
+ :return: Returns the result object.
662
+ """ # noqa: E501
663
+
664
+ _param = self._get_ip_batch_status_serialize(
665
+ job_id=job_id,
666
+ _request_auth=_request_auth,
667
+ _content_type=_content_type,
668
+ _headers=_headers,
669
+ _host_index=_host_index
670
+ )
671
+
672
+ _response_types_map: Dict[str, Optional[str]] = {
673
+ '200': "GetEmailBatchStatus200Response",
674
+ '404': "GetEmailBatchStatus404Response",
675
+ '403': "BatchAnalyzeEmails403Response",
676
+ '500': "AnalyzeEmail500Response",
677
+ }
678
+ response_data = self.api_client.call_api(
679
+ *_param,
680
+ _request_timeout=_request_timeout
681
+ )
682
+ response_data.read()
683
+ return self.api_client.response_deserialize(
684
+ response_data=response_data,
685
+ response_types_map=_response_types_map,
686
+ ).data
687
+
688
+
689
+ @validate_call
690
+ def get_ip_batch_status_with_http_info(
691
+ self,
692
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job to retrieve status for.")],
693
+ _request_timeout: Union[
694
+ None,
695
+ Annotated[StrictFloat, Field(gt=0)],
696
+ Tuple[
697
+ Annotated[StrictFloat, Field(gt=0)],
698
+ Annotated[StrictFloat, Field(gt=0)]
699
+ ]
700
+ ] = None,
701
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
702
+ _content_type: Optional[StrictStr] = None,
703
+ _headers: Optional[Dict[StrictStr, Any]] = None,
704
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
705
+ ) -> ApiResponse[GetEmailBatchStatus200Response]:
706
+ """Get IP Batch Status
707
+
708
+ The **Get IP 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 IP 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.
709
+
710
+ :param job_id: The unique identifier of the batch job to retrieve status for. (required)
711
+ :type job_id: str
712
+ :param _request_timeout: timeout setting for this request. If one
713
+ number provided, it will be total request
714
+ timeout. It can also be a pair (tuple) of
715
+ (connection, read) timeouts.
716
+ :type _request_timeout: int, tuple(int, int), optional
717
+ :param _request_auth: set to override the auth_settings for an a single
718
+ request; this effectively ignores the
719
+ authentication in the spec for a single request.
720
+ :type _request_auth: dict, optional
721
+ :param _content_type: force content-type for the request.
722
+ :type _content_type: str, Optional
723
+ :param _headers: set to override the headers for a single
724
+ request; this effectively ignores the headers
725
+ in the spec for a single request.
726
+ :type _headers: dict, optional
727
+ :param _host_index: set to override the host_index for a single
728
+ request; this effectively ignores the host_index
729
+ in the spec for a single request.
730
+ :type _host_index: int, optional
731
+ :return: Returns the result object.
732
+ """ # noqa: E501
733
+
734
+ _param = self._get_ip_batch_status_serialize(
735
+ job_id=job_id,
736
+ _request_auth=_request_auth,
737
+ _content_type=_content_type,
738
+ _headers=_headers,
739
+ _host_index=_host_index
740
+ )
741
+
742
+ _response_types_map: Dict[str, Optional[str]] = {
743
+ '200': "GetEmailBatchStatus200Response",
744
+ '404': "GetEmailBatchStatus404Response",
745
+ '403': "BatchAnalyzeEmails403Response",
746
+ '500': "AnalyzeEmail500Response",
747
+ }
748
+ response_data = self.api_client.call_api(
749
+ *_param,
750
+ _request_timeout=_request_timeout
751
+ )
752
+ response_data.read()
753
+ return self.api_client.response_deserialize(
754
+ response_data=response_data,
755
+ response_types_map=_response_types_map,
756
+ )
757
+
758
+
759
+ @validate_call
760
+ def get_ip_batch_status_without_preload_content(
761
+ self,
762
+ job_id: Annotated[StrictStr, Field(description="The unique identifier of the batch job to retrieve status for.")],
763
+ _request_timeout: Union[
764
+ None,
765
+ Annotated[StrictFloat, Field(gt=0)],
766
+ Tuple[
767
+ Annotated[StrictFloat, Field(gt=0)],
768
+ Annotated[StrictFloat, Field(gt=0)]
769
+ ]
770
+ ] = None,
771
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
772
+ _content_type: Optional[StrictStr] = None,
773
+ _headers: Optional[Dict[StrictStr, Any]] = None,
774
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
775
+ ) -> RESTResponseType:
776
+ """Get IP Batch Status
777
+
778
+ The **Get IP 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 IP 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.
779
+
780
+ :param job_id: The unique identifier of the batch job to retrieve status for. (required)
781
+ :type job_id: str
782
+ :param _request_timeout: timeout setting for this request. If one
783
+ number provided, it will be total request
784
+ timeout. It can also be a pair (tuple) of
785
+ (connection, read) timeouts.
786
+ :type _request_timeout: int, tuple(int, int), optional
787
+ :param _request_auth: set to override the auth_settings for an a single
788
+ request; this effectively ignores the
789
+ authentication in the spec for a single request.
790
+ :type _request_auth: dict, optional
791
+ :param _content_type: force content-type for the request.
792
+ :type _content_type: str, Optional
793
+ :param _headers: set to override the headers for a single
794
+ request; this effectively ignores the headers
795
+ in the spec for a single request.
796
+ :type _headers: dict, optional
797
+ :param _host_index: set to override the host_index for a single
798
+ request; this effectively ignores the host_index
799
+ in the spec for a single request.
800
+ :type _host_index: int, optional
801
+ :return: Returns the result object.
802
+ """ # noqa: E501
803
+
804
+ _param = self._get_ip_batch_status_serialize(
805
+ job_id=job_id,
806
+ _request_auth=_request_auth,
807
+ _content_type=_content_type,
808
+ _headers=_headers,
809
+ _host_index=_host_index
810
+ )
811
+
812
+ _response_types_map: Dict[str, Optional[str]] = {
813
+ '200': "GetEmailBatchStatus200Response",
814
+ '404': "GetEmailBatchStatus404Response",
815
+ '403': "BatchAnalyzeEmails403Response",
816
+ '500': "AnalyzeEmail500Response",
817
+ }
818
+ response_data = self.api_client.call_api(
819
+ *_param,
820
+ _request_timeout=_request_timeout
821
+ )
822
+ return response_data.response
823
+
824
+
825
+ def _get_ip_batch_status_serialize(
826
+ self,
827
+ job_id,
828
+ _request_auth,
829
+ _content_type,
830
+ _headers,
831
+ _host_index,
832
+ ) -> RequestSerialized:
833
+
834
+ _host = None
835
+
836
+ _collection_formats: Dict[str, str] = {
837
+ }
838
+
839
+ _path_params: Dict[str, str] = {}
840
+ _query_params: List[Tuple[str, str]] = []
841
+ _header_params: Dict[str, Optional[str]] = _headers or {}
842
+ _form_params: List[Tuple[str, str]] = []
843
+ _files: Dict[
844
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
845
+ ] = {}
846
+ _body_params: Optional[bytes] = None
847
+
848
+ # process the path parameters
849
+ if job_id is not None:
850
+ _path_params['jobId'] = job_id
851
+ # process the query parameters
852
+ # process the header parameters
853
+ # process the form parameters
854
+ # process the body parameter
855
+
856
+
857
+ # set the HTTP header `Accept`
858
+ if 'Accept' not in _header_params:
859
+ _header_params['Accept'] = self.api_client.select_header_accept(
860
+ [
861
+ 'application/json'
862
+ ]
863
+ )
864
+
865
+
866
+ # authentication setting
867
+ _auth_settings: List[str] = [
868
+ 'opportifyToken'
869
+ ]
870
+
871
+ return self.api_client.param_serialize(
872
+ method='GET',
873
+ resource_path='/ip/batch/{jobId}',
874
+ path_params=_path_params,
875
+ query_params=_query_params,
876
+ header_params=_header_params,
877
+ body=_body_params,
878
+ post_params=_form_params,
879
+ files=_files,
880
+ auth_settings=_auth_settings,
881
+ collection_formats=_collection_formats,
882
+ _host=_host,
883
+ _request_auth=_request_auth
884
+ )
885
+
886
+