opportify-sdk 0.1.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.
Files changed (49) hide show
  1. lib/__init__.py +0 -0
  2. lib/v1/__init__.py +0 -0
  3. lib/v1/openapi_client/__init__.py +63 -0
  4. lib/v1/openapi_client/api/__init__.py +6 -0
  5. lib/v1/openapi_client/api/email_insights_api.py +317 -0
  6. lib/v1/openapi_client/api/ip_insights_api.py +322 -0
  7. lib/v1/openapi_client/api_client.py +797 -0
  8. lib/v1/openapi_client/api_response.py +21 -0
  9. lib/v1/openapi_client/configuration.py +595 -0
  10. lib/v1/openapi_client/exceptions.py +199 -0
  11. lib/v1/openapi_client/models/__init__.py +45 -0
  12. lib/v1/openapi_client/models/abuse_contact.py +99 -0
  13. lib/v1/openapi_client/models/admin_contact.py +99 -0
  14. lib/v1/openapi_client/models/analyze_email200_response.py +113 -0
  15. lib/v1/openapi_client/models/analyze_email400_response.py +91 -0
  16. lib/v1/openapi_client/models/analyze_email400_response_error.py +137 -0
  17. lib/v1/openapi_client/models/analyze_email500_response.py +91 -0
  18. lib/v1/openapi_client/models/analyze_email500_response_error.py +89 -0
  19. lib/v1/openapi_client/models/analyze_email_request.py +92 -0
  20. lib/v1/openapi_client/models/analyze_ip200_response.py +127 -0
  21. lib/v1/openapi_client/models/analyze_ip400_response.py +91 -0
  22. lib/v1/openapi_client/models/analyze_ip400_response_error.py +137 -0
  23. lib/v1/openapi_client/models/analyze_ip404_response.py +91 -0
  24. lib/v1/openapi_client/models/analyze_ip500_response.py +91 -0
  25. lib/v1/openapi_client/models/analyze_ip_request.py +89 -0
  26. lib/v1/openapi_client/models/asn.py +93 -0
  27. lib/v1/openapi_client/models/block_listed.py +94 -0
  28. lib/v1/openapi_client/models/email_dns.py +87 -0
  29. lib/v1/openapi_client/models/geo.py +113 -0
  30. lib/v1/openapi_client/models/internalerror.py +89 -0
  31. lib/v1/openapi_client/models/invalidemail.py +89 -0
  32. lib/v1/openapi_client/models/ipvalidationfailed.py +89 -0
  33. lib/v1/openapi_client/models/malformedrequest.py +89 -0
  34. lib/v1/openapi_client/models/malformedrequest1.py +89 -0
  35. lib/v1/openapi_client/models/notfound.py +89 -0
  36. lib/v1/openapi_client/models/organization.py +103 -0
  37. lib/v1/openapi_client/models/risk_report.py +89 -0
  38. lib/v1/openapi_client/models/tech_contact.py +99 -0
  39. lib/v1/openapi_client/models/trusted_provider.py +93 -0
  40. lib/v1/openapi_client/models/whois.py +117 -0
  41. lib/v1/openapi_client/py.typed +0 -0
  42. lib/v1/openapi_client/rest.py +257 -0
  43. opportify_sdk-0.1.0.dist-info/METADATA +16 -0
  44. opportify_sdk-0.1.0.dist-info/RECORD +49 -0
  45. opportify_sdk-0.1.0.dist-info/WHEEL +5 -0
  46. opportify_sdk-0.1.0.dist-info/top_level.txt +2 -0
  47. src/__init__.py +6 -0
  48. src/email_insights.py +97 -0
  49. src/ip_insights.py +93 -0
@@ -0,0 +1,199 @@
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
+ from typing import Any, Optional
15
+ from typing_extensions import Self
16
+
17
+ class OpenApiException(Exception):
18
+ """The base exception class for all OpenAPIExceptions"""
19
+
20
+
21
+ class ApiTypeError(OpenApiException, TypeError):
22
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
23
+ key_type=None) -> None:
24
+ """ Raises an exception for TypeErrors
25
+
26
+ Args:
27
+ msg (str): the exception message
28
+
29
+ Keyword Args:
30
+ path_to_item (list): a list of keys an indices to get to the
31
+ current_item
32
+ None if unset
33
+ valid_classes (tuple): the primitive classes that current item
34
+ should be an instance of
35
+ None if unset
36
+ key_type (bool): False if our value is a value in a dict
37
+ True if it is a key in a dict
38
+ False if our item is an item in a list
39
+ None if unset
40
+ """
41
+ self.path_to_item = path_to_item
42
+ self.valid_classes = valid_classes
43
+ self.key_type = key_type
44
+ full_msg = msg
45
+ if path_to_item:
46
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
47
+ super(ApiTypeError, self).__init__(full_msg)
48
+
49
+
50
+ class ApiValueError(OpenApiException, ValueError):
51
+ def __init__(self, msg, path_to_item=None) -> None:
52
+ """
53
+ Args:
54
+ msg (str): the exception message
55
+
56
+ Keyword Args:
57
+ path_to_item (list) the path to the exception in the
58
+ received_data dict. None if unset
59
+ """
60
+
61
+ self.path_to_item = path_to_item
62
+ full_msg = msg
63
+ if path_to_item:
64
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
65
+ super(ApiValueError, self).__init__(full_msg)
66
+
67
+
68
+ class ApiAttributeError(OpenApiException, AttributeError):
69
+ def __init__(self, msg, path_to_item=None) -> None:
70
+ """
71
+ Raised when an attribute reference or assignment fails.
72
+
73
+ Args:
74
+ msg (str): the exception message
75
+
76
+ Keyword Args:
77
+ path_to_item (None/list) the path to the exception in the
78
+ received_data dict
79
+ """
80
+ self.path_to_item = path_to_item
81
+ full_msg = msg
82
+ if path_to_item:
83
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
84
+ super(ApiAttributeError, self).__init__(full_msg)
85
+
86
+
87
+ class ApiKeyError(OpenApiException, KeyError):
88
+ def __init__(self, msg, path_to_item=None) -> None:
89
+ """
90
+ Args:
91
+ msg (str): the exception message
92
+
93
+ Keyword Args:
94
+ path_to_item (None/list) the path to the exception in the
95
+ received_data dict
96
+ """
97
+ self.path_to_item = path_to_item
98
+ full_msg = msg
99
+ if path_to_item:
100
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
101
+ super(ApiKeyError, self).__init__(full_msg)
102
+
103
+
104
+ class ApiException(OpenApiException):
105
+
106
+ def __init__(
107
+ self,
108
+ status=None,
109
+ reason=None,
110
+ http_resp=None,
111
+ *,
112
+ body: Optional[str] = None,
113
+ data: Optional[Any] = None,
114
+ ) -> None:
115
+ self.status = status
116
+ self.reason = reason
117
+ self.body = body
118
+ self.data = data
119
+ self.headers = None
120
+
121
+ if http_resp:
122
+ if self.status is None:
123
+ self.status = http_resp.status
124
+ if self.reason is None:
125
+ self.reason = http_resp.reason
126
+ if self.body is None:
127
+ try:
128
+ self.body = http_resp.data.decode('utf-8')
129
+ except Exception:
130
+ pass
131
+ self.headers = http_resp.getheaders()
132
+
133
+ @classmethod
134
+ def from_response(
135
+ cls,
136
+ *,
137
+ http_resp,
138
+ body: Optional[str],
139
+ data: Optional[Any],
140
+ ) -> Self:
141
+ if http_resp.status == 400:
142
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
143
+
144
+ if http_resp.status == 401:
145
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
146
+
147
+ if http_resp.status == 403:
148
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
149
+
150
+ if http_resp.status == 404:
151
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
152
+
153
+ if 500 <= http_resp.status <= 599:
154
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
155
+ raise ApiException(http_resp=http_resp, body=body, data=data)
156
+
157
+ def __str__(self):
158
+ """Custom error messages for exception"""
159
+ error_message = "({0})\n"\
160
+ "Reason: {1}\n".format(self.status, self.reason)
161
+ if self.headers:
162
+ error_message += "HTTP response headers: {0}\n".format(
163
+ self.headers)
164
+
165
+ if self.data or self.body:
166
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
167
+
168
+ return error_message
169
+
170
+
171
+ class BadRequestException(ApiException):
172
+ pass
173
+
174
+
175
+ class NotFoundException(ApiException):
176
+ pass
177
+
178
+
179
+ class UnauthorizedException(ApiException):
180
+ pass
181
+
182
+
183
+ class ForbiddenException(ApiException):
184
+ pass
185
+
186
+
187
+ class ServiceException(ApiException):
188
+ pass
189
+
190
+
191
+ def render_path(path_to_item):
192
+ """Returns a string representation of a path"""
193
+ result = ""
194
+ for pth in path_to_item:
195
+ if isinstance(pth, int):
196
+ result += "[{0}]".format(pth)
197
+ else:
198
+ result += "['{0}']".format(pth)
199
+ return result
@@ -0,0 +1,45 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ Opportify Insights API
6
+
7
+ ## 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.
8
+
9
+ The version of the OpenAPI document: 1.0.0
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ # import models into model package
17
+ from openapi_client.models.abuse_contact import AbuseContact
18
+ from openapi_client.models.admin_contact import AdminContact
19
+ from openapi_client.models.analyze_email200_response import AnalyzeEmail200Response
20
+ from openapi_client.models.analyze_email400_response import AnalyzeEmail400Response
21
+ from openapi_client.models.analyze_email400_response_error import AnalyzeEmail400ResponseError
22
+ from openapi_client.models.analyze_email500_response import AnalyzeEmail500Response
23
+ from openapi_client.models.analyze_email500_response_error import AnalyzeEmail500ResponseError
24
+ from openapi_client.models.analyze_email_request import AnalyzeEmailRequest
25
+ from openapi_client.models.analyze_ip200_response import AnalyzeIp200Response
26
+ from openapi_client.models.analyze_ip400_response import AnalyzeIp400Response
27
+ from openapi_client.models.analyze_ip400_response_error import AnalyzeIp400ResponseError
28
+ from openapi_client.models.analyze_ip404_response import AnalyzeIp404Response
29
+ from openapi_client.models.analyze_ip500_response import AnalyzeIp500Response
30
+ from openapi_client.models.analyze_ip_request import AnalyzeIpRequest
31
+ from openapi_client.models.asn import Asn
32
+ from openapi_client.models.block_listed import BlockListed
33
+ from openapi_client.models.email_dns import EmailDNS
34
+ from openapi_client.models.geo import Geo
35
+ from openapi_client.models.internalerror import INTERNALERROR
36
+ from openapi_client.models.invalidemail import INVALIDEMAIL
37
+ from openapi_client.models.ipvalidationfailed import IPVALIDATIONFAILED
38
+ from openapi_client.models.malformedrequest import MALFORMEDREQUEST
39
+ from openapi_client.models.malformedrequest1 import MALFORMEDREQUEST1
40
+ from openapi_client.models.notfound import NOTFOUND
41
+ from openapi_client.models.organization import Organization
42
+ from openapi_client.models.risk_report import RiskReport
43
+ from openapi_client.models.tech_contact import TechContact
44
+ from openapi_client.models.trusted_provider import TrustedProvider
45
+ from openapi_client.models.whois import Whois
@@ -0,0 +1,99 @@
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
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class AbuseContact(BaseModel):
26
+ """
27
+ Abuse contact details.
28
+ """ # noqa: E501
29
+ contact_id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the abuse contact.", alias="contactId")
30
+ contact_type: Optional[StrictStr] = Field(default=None, description="Type of contact (e.g., \"abuse\").", alias="contactType")
31
+ name: Optional[StrictStr] = Field(default=None, description="Name of the abuse contact.")
32
+ address: Optional[List[StrictStr]] = Field(default=None, description="Abuse contact address details.")
33
+ phone: Optional[List[StrictStr]] = Field(default=None, description="Contact phone numbers for abuse issues.")
34
+ fax: Optional[List[StrictStr]] = Field(default=None, description="Contact fax numbers for abuse issues.")
35
+ email: Optional[List[StrictStr]] = Field(default=None, description="Contact email addresses for abuse issues.")
36
+ __properties: ClassVar[List[str]] = ["contactId", "contactType", "name", "address", "phone", "fax", "email"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of AbuseContact from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of AbuseContact from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "contactId": obj.get("contactId"),
90
+ "contactType": obj.get("contactType"),
91
+ "name": obj.get("name"),
92
+ "address": obj.get("address"),
93
+ "phone": obj.get("phone"),
94
+ "fax": obj.get("fax"),
95
+ "email": obj.get("email")
96
+ })
97
+ return _obj
98
+
99
+
@@ -0,0 +1,99 @@
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
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class AdminContact(BaseModel):
26
+ """
27
+ Admin contact details.
28
+ """ # noqa: E501
29
+ contact_id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the admin contact.", alias="contactId")
30
+ contact_type: Optional[StrictStr] = Field(default=None, description="Type of contact (e.g., \"admin\").", alias="contactType")
31
+ name: Optional[StrictStr] = Field(default=None, description="Name of the admin contact.")
32
+ address: Optional[List[StrictStr]] = Field(default=None, description="Admin contact address details.")
33
+ phone: Optional[List[StrictStr]] = Field(default=None, description="Contact phone numbers for admin issues.")
34
+ fax: Optional[List[StrictStr]] = Field(default=None, description="Contact fax numbers for admin issues.")
35
+ email: Optional[List[StrictStr]] = Field(default=None, description="Contact email addresses for admin issues.")
36
+ __properties: ClassVar[List[str]] = ["contactId", "contactType", "name", "address", "phone", "fax", "email"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of AdminContact from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of AdminContact from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "contactId": obj.get("contactId"),
90
+ "contactType": obj.get("contactType"),
91
+ "name": obj.get("name"),
92
+ "address": obj.get("address"),
93
+ "phone": obj.get("phone"),
94
+ "fax": obj.get("fax"),
95
+ "email": obj.get("email")
96
+ })
97
+ return _obj
98
+
99
+
@@ -0,0 +1,113 @@
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
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from openapi_client.models.email_dns import EmailDNS
23
+ from openapi_client.models.risk_report import RiskReport
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class AnalyzeEmail200Response(BaseModel):
28
+ """
29
+ AnalyzeEmail200Response
30
+ """ # noqa: E501
31
+ email_address: StrictStr = Field(description="The validated email address.", alias="emailAddress")
32
+ email_provider: StrictStr = Field(description="The email provider or domain name.", alias="emailProvider")
33
+ email_type: StrictStr = Field(description="Type of email address (e.g., free, disposable, corporate, unknown).", alias="emailType")
34
+ is_format_valid: StrictBool = Field(description="Indicates if the email address has a valid format.", alias="isFormatValid")
35
+ email_correction: StrictStr = Field(description="Suggested corrected email address, if applicable.", alias="emailCorrection")
36
+ is_deliverable: StrictBool = Field(description="Checks if the email address exists and is deliverable using SMTP handshake simulation. This involves connecting to the mail server and issuing commands to verify deliverability. ", alias="isDeliverable")
37
+ is_catch_all: StrictBool = Field(description="Determines if the email domain is configured as a catch-all, which accepts emails for all addresses within the domain. This is verified through multiple email tests. ", alias="isCatchAll")
38
+ is_reachable: StrictBool = Field(description="Confirms if the email domain has valid MX DNS records using DNS lookup.", alias="isReachable")
39
+ email_dns: EmailDNS = Field(alias="emailDNS")
40
+ risk_report: RiskReport = Field(alias="riskReport")
41
+ __properties: ClassVar[List[str]] = ["emailAddress", "emailProvider", "emailType", "isFormatValid", "emailCorrection", "isDeliverable", "isCatchAll", "isReachable", "emailDNS", "riskReport"]
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of AnalyzeEmail200Response from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ # override the default output from pydantic by calling `to_dict()` of email_dns
83
+ if self.email_dns:
84
+ _dict['emailDNS'] = self.email_dns.to_dict()
85
+ # override the default output from pydantic by calling `to_dict()` of risk_report
86
+ if self.risk_report:
87
+ _dict['riskReport'] = self.risk_report.to_dict()
88
+ return _dict
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
+ """Create an instance of AnalyzeEmail200Response from a dict"""
93
+ if obj is None:
94
+ return None
95
+
96
+ if not isinstance(obj, dict):
97
+ return cls.model_validate(obj)
98
+
99
+ _obj = cls.model_validate({
100
+ "emailAddress": obj.get("emailAddress"),
101
+ "emailProvider": obj.get("emailProvider"),
102
+ "emailType": obj.get("emailType"),
103
+ "isFormatValid": obj.get("isFormatValid"),
104
+ "emailCorrection": obj.get("emailCorrection"),
105
+ "isDeliverable": obj.get("isDeliverable"),
106
+ "isCatchAll": obj.get("isCatchAll"),
107
+ "isReachable": obj.get("isReachable"),
108
+ "emailDNS": EmailDNS.from_dict(obj["emailDNS"]) if obj.get("emailDNS") is not None else None,
109
+ "riskReport": RiskReport.from_dict(obj["riskReport"]) if obj.get("riskReport") is not None else None
110
+ })
111
+ return _obj
112
+
113
+