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
@@ -1,317 +0,0 @@
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-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, corporate 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-reference/email-insights) - [**IP Insights:**](/docs/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-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 openapi_client.models.analyze_email200_response import AnalyzeEmail200Response
20
- from openapi_client.models.analyze_email_request import AnalyzeEmailRequest
21
-
22
- from openapi_client.api_client import ApiClient, RequestSerialized
23
- from openapi_client.api_response import ApiResponse
24
- from openapi_client.rest import RESTResponseType
25
-
26
-
27
- class EmailInsightsApi:
28
- """NOTE: This class is auto generated by OpenAPI Generator
29
- Ref: https://openapi-generator.tech
30
-
31
- Do not edit the class manually.
32
- """
33
-
34
- def __init__(self, api_client=None) -> None:
35
- if api_client is None:
36
- api_client = ApiClient.get_default()
37
- self.api_client = api_client
38
-
39
-
40
- @validate_call
41
- def analyze_email(
42
- self,
43
- analyze_email_request: AnalyzeEmailRequest,
44
- _request_timeout: Union[
45
- None,
46
- Annotated[StrictFloat, Field(gt=0)],
47
- Tuple[
48
- Annotated[StrictFloat, Field(gt=0)],
49
- Annotated[StrictFloat, Field(gt=0)]
50
- ]
51
- ] = None,
52
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
53
- _content_type: Optional[StrictStr] = None,
54
- _headers: Optional[Dict[StrictStr, Any]] = None,
55
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
56
- ) -> AnalyzeEmail200Response:
57
- """Analyze Email
58
-
59
- 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: - Validate email syntax. - Identify email types (free, disposable, corporate 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. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": 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.
60
-
61
- :param analyze_email_request: (required)
62
- :type analyze_email_request: AnalyzeEmailRequest
63
- :param _request_timeout: timeout setting for this request. If one
64
- number provided, it will be total request
65
- timeout. It can also be a pair (tuple) of
66
- (connection, read) timeouts.
67
- :type _request_timeout: int, tuple(int, int), optional
68
- :param _request_auth: set to override the auth_settings for an a single
69
- request; this effectively ignores the
70
- authentication in the spec for a single request.
71
- :type _request_auth: dict, optional
72
- :param _content_type: force content-type for the request.
73
- :type _content_type: str, Optional
74
- :param _headers: set to override the headers for a single
75
- request; this effectively ignores the headers
76
- in the spec for a single request.
77
- :type _headers: dict, optional
78
- :param _host_index: set to override the host_index for a single
79
- request; this effectively ignores the host_index
80
- in the spec for a single request.
81
- :type _host_index: int, optional
82
- :return: Returns the result object.
83
- """ # noqa: E501
84
-
85
- _param = self._analyze_email_serialize(
86
- analyze_email_request=analyze_email_request,
87
- _request_auth=_request_auth,
88
- _content_type=_content_type,
89
- _headers=_headers,
90
- _host_index=_host_index
91
- )
92
-
93
- _response_types_map: Dict[str, Optional[str]] = {
94
- '200': "AnalyzeEmail200Response",
95
- '400': "AnalyzeEmail400Response",
96
- '500': "AnalyzeEmail500Response",
97
- }
98
- response_data = self.api_client.call_api(
99
- *_param,
100
- _request_timeout=_request_timeout
101
- )
102
- response_data.read()
103
- return self.api_client.response_deserialize(
104
- response_data=response_data,
105
- response_types_map=_response_types_map,
106
- ).data
107
-
108
-
109
- @validate_call
110
- def analyze_email_with_http_info(
111
- self,
112
- analyze_email_request: AnalyzeEmailRequest,
113
- _request_timeout: Union[
114
- None,
115
- Annotated[StrictFloat, Field(gt=0)],
116
- Tuple[
117
- Annotated[StrictFloat, Field(gt=0)],
118
- Annotated[StrictFloat, Field(gt=0)]
119
- ]
120
- ] = None,
121
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
122
- _content_type: Optional[StrictStr] = None,
123
- _headers: Optional[Dict[StrictStr, Any]] = None,
124
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
125
- ) -> ApiResponse[AnalyzeEmail200Response]:
126
- """Analyze Email
127
-
128
- 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: - Validate email syntax. - Identify email types (free, disposable, corporate 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. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": 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.
129
-
130
- :param analyze_email_request: (required)
131
- :type analyze_email_request: AnalyzeEmailRequest
132
- :param _request_timeout: timeout setting for this request. If one
133
- number provided, it will be total request
134
- timeout. It can also be a pair (tuple) of
135
- (connection, read) timeouts.
136
- :type _request_timeout: int, tuple(int, int), optional
137
- :param _request_auth: set to override the auth_settings for an a single
138
- request; this effectively ignores the
139
- authentication in the spec for a single request.
140
- :type _request_auth: dict, optional
141
- :param _content_type: force content-type for the request.
142
- :type _content_type: str, Optional
143
- :param _headers: set to override the headers for a single
144
- request; this effectively ignores the headers
145
- in the spec for a single request.
146
- :type _headers: dict, optional
147
- :param _host_index: set to override the host_index for a single
148
- request; this effectively ignores the host_index
149
- in the spec for a single request.
150
- :type _host_index: int, optional
151
- :return: Returns the result object.
152
- """ # noqa: E501
153
-
154
- _param = self._analyze_email_serialize(
155
- analyze_email_request=analyze_email_request,
156
- _request_auth=_request_auth,
157
- _content_type=_content_type,
158
- _headers=_headers,
159
- _host_index=_host_index
160
- )
161
-
162
- _response_types_map: Dict[str, Optional[str]] = {
163
- '200': "AnalyzeEmail200Response",
164
- '400': "AnalyzeEmail400Response",
165
- '500': "AnalyzeEmail500Response",
166
- }
167
- response_data = self.api_client.call_api(
168
- *_param,
169
- _request_timeout=_request_timeout
170
- )
171
- response_data.read()
172
- return self.api_client.response_deserialize(
173
- response_data=response_data,
174
- response_types_map=_response_types_map,
175
- )
176
-
177
-
178
- @validate_call
179
- def analyze_email_without_preload_content(
180
- self,
181
- analyze_email_request: AnalyzeEmailRequest,
182
- _request_timeout: Union[
183
- None,
184
- Annotated[StrictFloat, Field(gt=0)],
185
- Tuple[
186
- Annotated[StrictFloat, Field(gt=0)],
187
- Annotated[StrictFloat, Field(gt=0)]
188
- ]
189
- ] = None,
190
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
191
- _content_type: Optional[StrictStr] = None,
192
- _headers: Optional[Dict[StrictStr, Any]] = None,
193
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
194
- ) -> RESTResponseType:
195
- """Analyze Email
196
-
197
- 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: - Validate email syntax. - Identify email types (free, disposable, corporate 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. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": 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.
198
-
199
- :param analyze_email_request: (required)
200
- :type analyze_email_request: AnalyzeEmailRequest
201
- :param _request_timeout: timeout setting for this request. If one
202
- number provided, it will be total request
203
- timeout. It can also be a pair (tuple) of
204
- (connection, read) timeouts.
205
- :type _request_timeout: int, tuple(int, int), optional
206
- :param _request_auth: set to override the auth_settings for an a single
207
- request; this effectively ignores the
208
- authentication in the spec for a single request.
209
- :type _request_auth: dict, optional
210
- :param _content_type: force content-type for the request.
211
- :type _content_type: str, Optional
212
- :param _headers: set to override the headers for a single
213
- request; this effectively ignores the headers
214
- in the spec for a single request.
215
- :type _headers: dict, optional
216
- :param _host_index: set to override the host_index for a single
217
- request; this effectively ignores the host_index
218
- in the spec for a single request.
219
- :type _host_index: int, optional
220
- :return: Returns the result object.
221
- """ # noqa: E501
222
-
223
- _param = self._analyze_email_serialize(
224
- analyze_email_request=analyze_email_request,
225
- _request_auth=_request_auth,
226
- _content_type=_content_type,
227
- _headers=_headers,
228
- _host_index=_host_index
229
- )
230
-
231
- _response_types_map: Dict[str, Optional[str]] = {
232
- '200': "AnalyzeEmail200Response",
233
- '400': "AnalyzeEmail400Response",
234
- '500': "AnalyzeEmail500Response",
235
- }
236
- response_data = self.api_client.call_api(
237
- *_param,
238
- _request_timeout=_request_timeout
239
- )
240
- return response_data.response
241
-
242
-
243
- def _analyze_email_serialize(
244
- self,
245
- analyze_email_request,
246
- _request_auth,
247
- _content_type,
248
- _headers,
249
- _host_index,
250
- ) -> RequestSerialized:
251
-
252
- _host = None
253
-
254
- _collection_formats: Dict[str, str] = {
255
- }
256
-
257
- _path_params: Dict[str, str] = {}
258
- _query_params: List[Tuple[str, str]] = []
259
- _header_params: Dict[str, Optional[str]] = _headers or {}
260
- _form_params: List[Tuple[str, str]] = []
261
- _files: Dict[
262
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
263
- ] = {}
264
- _body_params: Optional[bytes] = None
265
-
266
- # process the path parameters
267
- # process the query parameters
268
- # process the header parameters
269
- # process the form parameters
270
- # process the body parameter
271
- if analyze_email_request is not None:
272
- _body_params = analyze_email_request
273
-
274
-
275
- # set the HTTP header `Accept`
276
- if 'Accept' not in _header_params:
277
- _header_params['Accept'] = self.api_client.select_header_accept(
278
- [
279
- 'application/json'
280
- ]
281
- )
282
-
283
- # set the HTTP header `Content-Type`
284
- if _content_type:
285
- _header_params['Content-Type'] = _content_type
286
- else:
287
- _default_content_type = (
288
- self.api_client.select_header_content_type(
289
- [
290
- 'application/json'
291
- ]
292
- )
293
- )
294
- if _default_content_type is not None:
295
- _header_params['Content-Type'] = _default_content_type
296
-
297
- # authentication setting
298
- _auth_settings: List[str] = [
299
- 'opportifyToken'
300
- ]
301
-
302
- return self.api_client.param_serialize(
303
- method='POST',
304
- resource_path='/email/analyze',
305
- path_params=_path_params,
306
- query_params=_query_params,
307
- header_params=_header_params,
308
- body=_body_params,
309
- post_params=_form_params,
310
- files=_files,
311
- auth_settings=_auth_settings,
312
- collection_formats=_collection_formats,
313
- _host=_host,
314
- _request_auth=_request_auth
315
- )
316
-
317
-
@@ -1,322 +0,0 @@
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-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, corporate 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-reference/email-insights) - [**IP Insights:**](/docs/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-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 openapi_client.models.analyze_ip200_response import AnalyzeIp200Response
20
- from openapi_client.models.analyze_ip_request import AnalyzeIpRequest
21
-
22
- from openapi_client.api_client import ApiClient, RequestSerialized
23
- from openapi_client.api_response import ApiResponse
24
- from openapi_client.rest import RESTResponseType
25
-
26
-
27
- class IPInsightsApi:
28
- """NOTE: This class is auto generated by OpenAPI Generator
29
- Ref: https://openapi-generator.tech
30
-
31
- Do not edit the class manually.
32
- """
33
-
34
- def __init__(self, api_client=None) -> None:
35
- if api_client is None:
36
- api_client = ApiClient.get_default()
37
- self.api_client = api_client
38
-
39
-
40
- @validate_call
41
- def analyze_ip(
42
- self,
43
- analyze_ip_request: AnalyzeIpRequest,
44
- _request_timeout: Union[
45
- None,
46
- Annotated[StrictFloat, Field(gt=0)],
47
- Tuple[
48
- Annotated[StrictFloat, Field(gt=0)],
49
- Annotated[StrictFloat, Field(gt=0)]
50
- ]
51
- ] = None,
52
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
53
- _content_type: Optional[StrictStr] = None,
54
- _headers: Optional[Dict[StrictStr, Any]] = None,
55
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
56
- ) -> AnalyzeIp200Response:
57
- """Analyze IP
58
-
59
- 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.
60
-
61
- :param analyze_ip_request: (required)
62
- :type analyze_ip_request: AnalyzeIpRequest
63
- :param _request_timeout: timeout setting for this request. If one
64
- number provided, it will be total request
65
- timeout. It can also be a pair (tuple) of
66
- (connection, read) timeouts.
67
- :type _request_timeout: int, tuple(int, int), optional
68
- :param _request_auth: set to override the auth_settings for an a single
69
- request; this effectively ignores the
70
- authentication in the spec for a single request.
71
- :type _request_auth: dict, optional
72
- :param _content_type: force content-type for the request.
73
- :type _content_type: str, Optional
74
- :param _headers: set to override the headers for a single
75
- request; this effectively ignores the headers
76
- in the spec for a single request.
77
- :type _headers: dict, optional
78
- :param _host_index: set to override the host_index for a single
79
- request; this effectively ignores the host_index
80
- in the spec for a single request.
81
- :type _host_index: int, optional
82
- :return: Returns the result object.
83
- """ # noqa: E501
84
-
85
- _param = self._analyze_ip_serialize(
86
- analyze_ip_request=analyze_ip_request,
87
- _request_auth=_request_auth,
88
- _content_type=_content_type,
89
- _headers=_headers,
90
- _host_index=_host_index
91
- )
92
-
93
- print ("_param", _param)
94
-
95
- _response_types_map: Dict[str, Optional[str]] = {
96
- '200': "AnalyzeIp200Response",
97
- '400': "AnalyzeIp400Response",
98
- '404': "AnalyzeIp404Response",
99
- '500': "AnalyzeIp500Response",
100
- }
101
- response_data = self.api_client.call_api(
102
- *_param,
103
- _request_timeout=_request_timeout
104
- )
105
- response_data.read()
106
- return self.api_client.response_deserialize(
107
- response_data=response_data,
108
- response_types_map=_response_types_map,
109
- ).data
110
-
111
-
112
- @validate_call
113
- def analyze_ip_with_http_info(
114
- self,
115
- analyze_ip_request: AnalyzeIpRequest,
116
- _request_timeout: Union[
117
- None,
118
- Annotated[StrictFloat, Field(gt=0)],
119
- Tuple[
120
- Annotated[StrictFloat, Field(gt=0)],
121
- Annotated[StrictFloat, Field(gt=0)]
122
- ]
123
- ] = None,
124
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
125
- _content_type: Optional[StrictStr] = None,
126
- _headers: Optional[Dict[StrictStr, Any]] = None,
127
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
128
- ) -> ApiResponse[AnalyzeIp200Response]:
129
- """Analyze IP
130
-
131
- 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.
132
-
133
- :param analyze_ip_request: (required)
134
- :type analyze_ip_request: AnalyzeIpRequest
135
- :param _request_timeout: timeout setting for this request. If one
136
- number provided, it will be total request
137
- timeout. It can also be a pair (tuple) of
138
- (connection, read) timeouts.
139
- :type _request_timeout: int, tuple(int, int), optional
140
- :param _request_auth: set to override the auth_settings for an a single
141
- request; this effectively ignores the
142
- authentication in the spec for a single request.
143
- :type _request_auth: dict, optional
144
- :param _content_type: force content-type for the request.
145
- :type _content_type: str, Optional
146
- :param _headers: set to override the headers for a single
147
- request; this effectively ignores the headers
148
- in the spec for a single request.
149
- :type _headers: dict, optional
150
- :param _host_index: set to override the host_index for a single
151
- request; this effectively ignores the host_index
152
- in the spec for a single request.
153
- :type _host_index: int, optional
154
- :return: Returns the result object.
155
- """ # noqa: E501
156
-
157
- _param = self._analyze_ip_serialize(
158
- analyze_ip_request=analyze_ip_request,
159
- _request_auth=_request_auth,
160
- _content_type=_content_type,
161
- _headers=_headers,
162
- _host_index=_host_index
163
- )
164
-
165
- _response_types_map: Dict[str, Optional[str]] = {
166
- '200': "AnalyzeIp200Response",
167
- '400': "AnalyzeIp400Response",
168
- '404': "AnalyzeIp404Response",
169
- '500': "AnalyzeIp500Response",
170
- }
171
- response_data = self.api_client.call_api(
172
- *_param,
173
- _request_timeout=_request_timeout
174
- )
175
- response_data.read()
176
- return self.api_client.response_deserialize(
177
- response_data=response_data,
178
- response_types_map=_response_types_map,
179
- )
180
-
181
-
182
- @validate_call
183
- def analyze_ip_without_preload_content(
184
- self,
185
- analyze_ip_request: AnalyzeIpRequest,
186
- _request_timeout: Union[
187
- None,
188
- Annotated[StrictFloat, Field(gt=0)],
189
- Tuple[
190
- Annotated[StrictFloat, Field(gt=0)],
191
- Annotated[StrictFloat, Field(gt=0)]
192
- ]
193
- ] = None,
194
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
195
- _content_type: Optional[StrictStr] = None,
196
- _headers: Optional[Dict[StrictStr, Any]] = None,
197
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
198
- ) -> RESTResponseType:
199
- """Analyze IP
200
-
201
- 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.
202
-
203
- :param analyze_ip_request: (required)
204
- :type analyze_ip_request: AnalyzeIpRequest
205
- :param _request_timeout: timeout setting for this request. If one
206
- number provided, it will be total request
207
- timeout. It can also be a pair (tuple) of
208
- (connection, read) timeouts.
209
- :type _request_timeout: int, tuple(int, int), optional
210
- :param _request_auth: set to override the auth_settings for an a single
211
- request; this effectively ignores the
212
- authentication in the spec for a single request.
213
- :type _request_auth: dict, optional
214
- :param _content_type: force content-type for the request.
215
- :type _content_type: str, Optional
216
- :param _headers: set to override the headers for a single
217
- request; this effectively ignores the headers
218
- in the spec for a single request.
219
- :type _headers: dict, optional
220
- :param _host_index: set to override the host_index for a single
221
- request; this effectively ignores the host_index
222
- in the spec for a single request.
223
- :type _host_index: int, optional
224
- :return: Returns the result object.
225
- """ # noqa: E501
226
-
227
- _param = self._analyze_ip_serialize(
228
- analyze_ip_request=analyze_ip_request,
229
- _request_auth=_request_auth,
230
- _content_type=_content_type,
231
- _headers=_headers,
232
- _host_index=_host_index
233
- )
234
-
235
- _response_types_map: Dict[str, Optional[str]] = {
236
- '200': "AnalyzeIp200Response",
237
- '400': "AnalyzeIp400Response",
238
- '404': "AnalyzeIp404Response",
239
- '500': "AnalyzeIp500Response",
240
- }
241
- response_data = self.api_client.call_api(
242
- *_param,
243
- _request_timeout=_request_timeout
244
- )
245
- return response_data.response
246
-
247
-
248
- def _analyze_ip_serialize(
249
- self,
250
- analyze_ip_request,
251
- _request_auth,
252
- _content_type,
253
- _headers,
254
- _host_index,
255
- ) -> RequestSerialized:
256
-
257
- _host = None
258
-
259
- _collection_formats: Dict[str, str] = {
260
- }
261
-
262
- _path_params: Dict[str, str] = {}
263
- _query_params: List[Tuple[str, str]] = []
264
- _header_params: Dict[str, Optional[str]] = _headers or {}
265
- _form_params: List[Tuple[str, str]] = []
266
- _files: Dict[
267
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
268
- ] = {}
269
- _body_params: Optional[bytes] = None
270
-
271
- # process the path parameters
272
- # process the query parameters
273
- # process the header parameters
274
- # process the form parameters
275
- # process the body parameter
276
- if analyze_ip_request is not None:
277
- _body_params = analyze_ip_request
278
-
279
-
280
- # set the HTTP header `Accept`
281
- if 'Accept' not in _header_params:
282
- _header_params['Accept'] = self.api_client.select_header_accept(
283
- [
284
- 'application/json'
285
- ]
286
- )
287
-
288
- # set the HTTP header `Content-Type`
289
- if _content_type:
290
- _header_params['Content-Type'] = _content_type
291
- else:
292
- _default_content_type = (
293
- self.api_client.select_header_content_type(
294
- [
295
- 'application/json'
296
- ]
297
- )
298
- )
299
- if _default_content_type is not None:
300
- _header_params['Content-Type'] = _default_content_type
301
-
302
- # authentication setting
303
- _auth_settings: List[str] = [
304
- 'opportifyToken'
305
- ]
306
-
307
- return self.api_client.param_serialize(
308
- method='POST',
309
- resource_path='/ip/analyze',
310
- path_params=_path_params,
311
- query_params=_query_params,
312
- header_params=_header_params,
313
- body=_body_params,
314
- post_params=_form_params,
315
- files=_files,
316
- auth_settings=_auth_settings,
317
- collection_formats=_collection_formats,
318
- _host=_host,
319
- _request_auth=_request_auth
320
- )
321
-
322
-