opportify-sdk 0.1.0__tar.gz

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 (86) hide show
  1. opportify_sdk-0.1.0/PKG-INFO +16 -0
  2. opportify_sdk-0.1.0/README.md +94 -0
  3. opportify_sdk-0.1.0/lib/__init__.py +0 -0
  4. opportify_sdk-0.1.0/lib/v1/__init__.py +0 -0
  5. opportify_sdk-0.1.0/lib/v1/openapi_client/__init__.py +63 -0
  6. opportify_sdk-0.1.0/lib/v1/openapi_client/api/__init__.py +6 -0
  7. opportify_sdk-0.1.0/lib/v1/openapi_client/api/email_insights_api.py +317 -0
  8. opportify_sdk-0.1.0/lib/v1/openapi_client/api/ip_insights_api.py +322 -0
  9. opportify_sdk-0.1.0/lib/v1/openapi_client/api_client.py +797 -0
  10. opportify_sdk-0.1.0/lib/v1/openapi_client/api_response.py +21 -0
  11. opportify_sdk-0.1.0/lib/v1/openapi_client/configuration.py +595 -0
  12. opportify_sdk-0.1.0/lib/v1/openapi_client/exceptions.py +199 -0
  13. opportify_sdk-0.1.0/lib/v1/openapi_client/models/__init__.py +45 -0
  14. opportify_sdk-0.1.0/lib/v1/openapi_client/models/abuse_contact.py +99 -0
  15. opportify_sdk-0.1.0/lib/v1/openapi_client/models/admin_contact.py +99 -0
  16. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_email200_response.py +113 -0
  17. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_email400_response.py +91 -0
  18. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_email400_response_error.py +137 -0
  19. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_email500_response.py +91 -0
  20. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_email500_response_error.py +89 -0
  21. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_email_request.py +92 -0
  22. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_ip200_response.py +127 -0
  23. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_ip400_response.py +91 -0
  24. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_ip400_response_error.py +137 -0
  25. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_ip404_response.py +91 -0
  26. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_ip500_response.py +91 -0
  27. opportify_sdk-0.1.0/lib/v1/openapi_client/models/analyze_ip_request.py +89 -0
  28. opportify_sdk-0.1.0/lib/v1/openapi_client/models/asn.py +93 -0
  29. opportify_sdk-0.1.0/lib/v1/openapi_client/models/block_listed.py +94 -0
  30. opportify_sdk-0.1.0/lib/v1/openapi_client/models/email_dns.py +87 -0
  31. opportify_sdk-0.1.0/lib/v1/openapi_client/models/geo.py +113 -0
  32. opportify_sdk-0.1.0/lib/v1/openapi_client/models/internalerror.py +89 -0
  33. opportify_sdk-0.1.0/lib/v1/openapi_client/models/invalidemail.py +89 -0
  34. opportify_sdk-0.1.0/lib/v1/openapi_client/models/ipvalidationfailed.py +89 -0
  35. opportify_sdk-0.1.0/lib/v1/openapi_client/models/malformedrequest.py +89 -0
  36. opportify_sdk-0.1.0/lib/v1/openapi_client/models/malformedrequest1.py +89 -0
  37. opportify_sdk-0.1.0/lib/v1/openapi_client/models/notfound.py +89 -0
  38. opportify_sdk-0.1.0/lib/v1/openapi_client/models/organization.py +103 -0
  39. opportify_sdk-0.1.0/lib/v1/openapi_client/models/risk_report.py +89 -0
  40. opportify_sdk-0.1.0/lib/v1/openapi_client/models/tech_contact.py +99 -0
  41. opportify_sdk-0.1.0/lib/v1/openapi_client/models/trusted_provider.py +93 -0
  42. opportify_sdk-0.1.0/lib/v1/openapi_client/models/whois.py +117 -0
  43. opportify_sdk-0.1.0/lib/v1/openapi_client/py.typed +0 -0
  44. opportify_sdk-0.1.0/lib/v1/openapi_client/rest.py +257 -0
  45. opportify_sdk-0.1.0/opportify_sdk.egg-info/PKG-INFO +16 -0
  46. opportify_sdk-0.1.0/opportify_sdk.egg-info/SOURCES.txt +85 -0
  47. opportify_sdk-0.1.0/opportify_sdk.egg-info/dependency_links.txt +1 -0
  48. opportify_sdk-0.1.0/opportify_sdk.egg-info/requires.txt +4 -0
  49. opportify_sdk-0.1.0/opportify_sdk.egg-info/top_level.txt +2 -0
  50. opportify_sdk-0.1.0/pyproject.toml +89 -0
  51. opportify_sdk-0.1.0/setup.cfg +7 -0
  52. opportify_sdk-0.1.0/setup.py +38 -0
  53. opportify_sdk-0.1.0/src/__init__.py +6 -0
  54. opportify_sdk-0.1.0/src/email_insights.py +97 -0
  55. opportify_sdk-0.1.0/src/ip_insights.py +93 -0
  56. opportify_sdk-0.1.0/test/test_abuse_contact.py +57 -0
  57. opportify_sdk-0.1.0/test/test_admin_contact.py +57 -0
  58. opportify_sdk-0.1.0/test/test_analyze_email200_response.py +76 -0
  59. opportify_sdk-0.1.0/test/test_analyze_email400_response.py +51 -0
  60. opportify_sdk-0.1.0/test/test_analyze_email400_response_error.py +52 -0
  61. opportify_sdk-0.1.0/test/test_analyze_email500_response.py +53 -0
  62. opportify_sdk-0.1.0/test/test_analyze_email500_response_error.py +52 -0
  63. opportify_sdk-0.1.0/test/test_analyze_email_request.py +54 -0
  64. opportify_sdk-0.1.0/test/test_analyze_ip200_response.py +200 -0
  65. opportify_sdk-0.1.0/test/test_analyze_ip400_response.py +51 -0
  66. opportify_sdk-0.1.0/test/test_analyze_ip400_response_error.py +52 -0
  67. opportify_sdk-0.1.0/test/test_analyze_ip404_response.py +53 -0
  68. opportify_sdk-0.1.0/test/test_analyze_ip500_response.py +53 -0
  69. opportify_sdk-0.1.0/test/test_analyze_ip_request.py +53 -0
  70. opportify_sdk-0.1.0/test/test_asn.py +54 -0
  71. opportify_sdk-0.1.0/test/test_block_listed.py +57 -0
  72. opportify_sdk-0.1.0/test/test_email_dns.py +51 -0
  73. opportify_sdk-0.1.0/test/test_email_insights_api.py +38 -0
  74. opportify_sdk-0.1.0/test/test_geo.py +64 -0
  75. opportify_sdk-0.1.0/test/test_internalerror.py +52 -0
  76. opportify_sdk-0.1.0/test/test_invalidemail.py +52 -0
  77. opportify_sdk-0.1.0/test/test_ip_insights_api.py +38 -0
  78. opportify_sdk-0.1.0/test/test_ipvalidationfailed.py +52 -0
  79. opportify_sdk-0.1.0/test/test_malformedrequest.py +52 -0
  80. opportify_sdk-0.1.0/test/test_malformedrequest1.py +52 -0
  81. opportify_sdk-0.1.0/test/test_notfound.py +52 -0
  82. opportify_sdk-0.1.0/test/test_organization.py +59 -0
  83. opportify_sdk-0.1.0/test/test_risk_report.py +52 -0
  84. opportify_sdk-0.1.0/test/test_tech_contact.py +57 -0
  85. opportify_sdk-0.1.0/test/test_trusted_provider.py +55 -0
  86. opportify_sdk-0.1.0/test/test_whois.py +90 -0
@@ -0,0 +1,16 @@
1
+ Metadata-Version: 2.1
2
+ Name: opportify_sdk
3
+ Version: 0.1.0
4
+ Summary: Opportify Insights API
5
+ Home-page: https://github.com/opportify/opportify-sdk-python
6
+ Author: Opportify & OpenAPI-Generator
7
+ Author-email:
8
+ Keywords: OpenAPI,OpenAPI-Generator,Opportify Insights API,Opportify
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: urllib3<3.0.0,>=1.25.3
11
+ Requires-Dist: python-dateutil>=2.8.2
12
+ Requires-Dist: pydantic>=2
13
+ Requires-Dist: typing-extensions>=4.7.1
14
+
15
+ ## 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: &#x60;&#x60;&#x60;plaintext https://api.opportify.ai/insights/v1/&lt;service&gt;/&lt;endpoint&gt; &#x60;&#x60;&#x60; ### 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 &gt;&gt;](/docs/api-reference/email-insights) - [**IP Insights:**](/docs/api-reference/ip-insights) - Connection types: Detects connection types such as &#x60;wired&#x60;, &#x60;mobile&#x60;, &#x60;enterprise&#x60;, &#x60;satellite&#x60;, &#x60;VPN&#x60;, &#x60;cloud-provider&#x60;, &#x60;open-proxy&#x60;, or &#x60;Tor&#x60;. - 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 &gt;&gt;](/docs/api-reference/ip-insights) ### Authentication &amp; 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.
16
+
@@ -0,0 +1,94 @@
1
+ # Opportify-SDK-Python
2
+
3
+ ## Overview
4
+
5
+ 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.
6
+
7
+ [Sign Up Free](https://www.opportify.ai)
8
+
9
+ ### Base URL
10
+ Use the following base URL for all API requests:
11
+
12
+ ```plaintext
13
+ https://api.opportify.ai/insights/v1/<service>/<endpoint>
14
+ ```
15
+
16
+ ## Requirements
17
+
18
+ Requires Python v3.8 or later
19
+
20
+ ## Getting Started
21
+
22
+ First, install Opportify SDK via PyPI manager:
23
+
24
+ ```
25
+ pip install opportify-sdk
26
+ ```
27
+
28
+ ### Calling Email Insights
29
+
30
+ ```python
31
+ from opportify_sdk import EmailInsights
32
+
33
+ # Initialize the wrapper with your API key
34
+ api_key = "<YOUR-API-KEY-HERE>"
35
+ email_insights = EmailInsights(api_key)
36
+
37
+ # Optional: Configure host, version, and debug mode
38
+ email_insights.set_version("v1")
39
+
40
+ # Define request parameters
41
+ params = {
42
+ "email": "<SOME-EMAIL-HERE>",
43
+ "enableAutoCorrection": True,
44
+ "enableAi": True
45
+ }
46
+
47
+ # Call the API
48
+ try:
49
+ result = email_insights.analyze(params)
50
+ print("Response:", result)
51
+ except Exception as e:
52
+ print(f"Error: {e}")
53
+ ```
54
+
55
+ ### Calling IP Insights
56
+
57
+ ```python
58
+
59
+ from opportify_sdk import IpInsights
60
+
61
+ # Initialize the wrapper with your API key
62
+ api_key = "<YOUR-API-KEY-HERE>"
63
+ ip_insights = IpInsights(api_key)
64
+
65
+ # Optional: Configure host, version, and debug mode
66
+ ip_insights.set_version("v1")
67
+
68
+ # Define request parameters
69
+ params = {
70
+ "ip": "<SOME-IP-HERE>",
71
+ "enableAi": True
72
+ }
73
+
74
+ # Call the API
75
+ try:
76
+ result = ip_insights.analyze(params)
77
+ print("Response:", result)
78
+ except Exception as e:
79
+ print(f"Error: {e}")
80
+ ```
81
+
82
+ ### Enable Debug Mode
83
+
84
+ ```python
85
+ ip_insights.set_version("v1").set_debug_mode(True)
86
+ email_insights.set_version("v1").set_debug_mode(False)
87
+ ```
88
+
89
+ ## About this package
90
+
91
+ This Python package is a customization of the base generated by:
92
+
93
+ - [OpenAPI Generator](https://openapi-generator.tech) project.
94
+
File without changes
File without changes
@@ -0,0 +1,63 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Opportify Insights API
7
+
8
+ ## 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.
9
+
10
+ The version of the OpenAPI document: 1.0.0
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "1.0.0"
18
+
19
+ # import apis into sdk package
20
+ from openapi_client.api.email_insights_api import EmailInsightsApi
21
+ from openapi_client.api.ip_insights_api import IPInsightsApi
22
+
23
+ # import ApiClient
24
+ from openapi_client.api_response import ApiResponse
25
+ from openapi_client.api_client import ApiClient
26
+ from openapi_client.configuration import Configuration
27
+ from openapi_client.exceptions import OpenApiException
28
+ from openapi_client.exceptions import ApiTypeError
29
+ from openapi_client.exceptions import ApiValueError
30
+ from openapi_client.exceptions import ApiKeyError
31
+ from openapi_client.exceptions import ApiAttributeError
32
+ from openapi_client.exceptions import ApiException
33
+
34
+ # import models into sdk package
35
+ from openapi_client.models.abuse_contact import AbuseContact
36
+ from openapi_client.models.admin_contact import AdminContact
37
+ from openapi_client.models.analyze_email200_response import AnalyzeEmail200Response
38
+ from openapi_client.models.analyze_email400_response import AnalyzeEmail400Response
39
+ from openapi_client.models.analyze_email400_response_error import AnalyzeEmail400ResponseError
40
+ from openapi_client.models.analyze_email500_response import AnalyzeEmail500Response
41
+ from openapi_client.models.analyze_email500_response_error import AnalyzeEmail500ResponseError
42
+ from openapi_client.models.analyze_email_request import AnalyzeEmailRequest
43
+ from openapi_client.models.analyze_ip200_response import AnalyzeIp200Response
44
+ from openapi_client.models.analyze_ip400_response import AnalyzeIp400Response
45
+ from openapi_client.models.analyze_ip400_response_error import AnalyzeIp400ResponseError
46
+ from openapi_client.models.analyze_ip404_response import AnalyzeIp404Response
47
+ from openapi_client.models.analyze_ip500_response import AnalyzeIp500Response
48
+ from openapi_client.models.analyze_ip_request import AnalyzeIpRequest
49
+ from openapi_client.models.asn import Asn
50
+ from openapi_client.models.block_listed import BlockListed
51
+ from openapi_client.models.email_dns import EmailDNS
52
+ from openapi_client.models.geo import Geo
53
+ from openapi_client.models.internalerror import INTERNALERROR
54
+ from openapi_client.models.invalidemail import INVALIDEMAIL
55
+ from openapi_client.models.ipvalidationfailed import IPVALIDATIONFAILED
56
+ from openapi_client.models.malformedrequest import MALFORMEDREQUEST
57
+ from openapi_client.models.malformedrequest1 import MALFORMEDREQUEST1
58
+ from openapi_client.models.notfound import NOTFOUND
59
+ from openapi_client.models.organization import Organization
60
+ from openapi_client.models.risk_report import RiskReport
61
+ from openapi_client.models.tech_contact import TechContact
62
+ from openapi_client.models.trusted_provider import TrustedProvider
63
+ from openapi_client.models.whois import Whois
@@ -0,0 +1,6 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from openapi_client.api.email_insights_api import EmailInsightsApi
5
+ from openapi_client.api.ip_insights_api import IPInsightsApi
6
+
@@ -0,0 +1,317 @@
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
+