ipgeolocationio 1.0.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 (84) hide show
  1. ipgeolocation/__init__.py +102 -0
  2. ipgeolocation/api/__init__.py +12 -0
  3. ipgeolocation/api/abuse_contact_api.py +358 -0
  4. ipgeolocation/api/asn_lookup_api.py +392 -0
  5. ipgeolocation/api/astronomy_api.py +858 -0
  6. ipgeolocation/api/ip_security_api.py +798 -0
  7. ipgeolocation/api/ipgeolocation_api.py +810 -0
  8. ipgeolocation/api/time_conversion_api.py +562 -0
  9. ipgeolocation/api/timezone_api.py +477 -0
  10. ipgeolocation/api/user_agent_api.py +958 -0
  11. ipgeolocation/api_client.py +798 -0
  12. ipgeolocation/api_response.py +21 -0
  13. ipgeolocation/configuration.py +602 -0
  14. ipgeolocation/exceptions.py +216 -0
  15. ipgeolocation/models/__init__.py +78 -0
  16. ipgeolocation/models/abuse.py +105 -0
  17. ipgeolocation/models/abuse_response.py +93 -0
  18. ipgeolocation/models/abuse_response_xml.py +93 -0
  19. ipgeolocation/models/asn_connection.py +91 -0
  20. ipgeolocation/models/asn_details.py +139 -0
  21. ipgeolocation/models/asn_response.py +93 -0
  22. ipgeolocation/models/asn_response_xml.py +93 -0
  23. ipgeolocation/models/astronomy.py +145 -0
  24. ipgeolocation/models/astronomy_evening.py +105 -0
  25. ipgeolocation/models/astronomy_location.py +119 -0
  26. ipgeolocation/models/astronomy_morning.py +105 -0
  27. ipgeolocation/models/astronomy_response.py +99 -0
  28. ipgeolocation/models/astronomy_xml_response.py +99 -0
  29. ipgeolocation/models/country_metadata.py +91 -0
  30. ipgeolocation/models/currency.py +91 -0
  31. ipgeolocation/models/error_response.py +87 -0
  32. ipgeolocation/models/error_xml_response.py +87 -0
  33. ipgeolocation/models/error_xml_response_array.py +87 -0
  34. ipgeolocation/models/geolocation_response.py +139 -0
  35. ipgeolocation/models/geolocation_xml_response.py +139 -0
  36. ipgeolocation/models/geolocation_xml_response_array.py +139 -0
  37. ipgeolocation/models/get_bulk_ip_geolocation_request.py +88 -0
  38. ipgeolocation/models/get_bulk_ip_geolocation_response.py +145 -0
  39. ipgeolocation/models/get_bulk_ip_geolocation_xml_response.py +137 -0
  40. ipgeolocation/models/get_bulk_ip_security_info_response.py +146 -0
  41. ipgeolocation/models/get_bulk_ip_security_info_xml_response.py +137 -0
  42. ipgeolocation/models/ip_security_api_response.py +131 -0
  43. ipgeolocation/models/ip_security_api_xml_response.py +131 -0
  44. ipgeolocation/models/ip_security_api_xml_response_array.py +131 -0
  45. ipgeolocation/models/location.py +127 -0
  46. ipgeolocation/models/location_minimal.py +121 -0
  47. ipgeolocation/models/network.py +99 -0
  48. ipgeolocation/models/network_asn.py +107 -0
  49. ipgeolocation/models/network_company.py +91 -0
  50. ipgeolocation/models/network_minimal.py +97 -0
  51. ipgeolocation/models/network_minimal_asn.py +91 -0
  52. ipgeolocation/models/network_minimal_company.py +87 -0
  53. ipgeolocation/models/parse_bulk_user_agent_strings_request.py +87 -0
  54. ipgeolocation/models/parse_user_agent_string_request.py +87 -0
  55. ipgeolocation/models/security.py +107 -0
  56. ipgeolocation/models/time_conversion_response.py +93 -0
  57. ipgeolocation/models/time_conversion_xml_response.py +93 -0
  58. ipgeolocation/models/time_series.py +123 -0
  59. ipgeolocation/models/time_series_response.py +103 -0
  60. ipgeolocation/models/time_series_xml_response.py +103 -0
  61. ipgeolocation/models/time_zone.py +113 -0
  62. ipgeolocation/models/time_zone_detailed_response.py +111 -0
  63. ipgeolocation/models/time_zone_detailed_xml_response.py +111 -0
  64. ipgeolocation/models/time_zone_dst_end.py +97 -0
  65. ipgeolocation/models/time_zone_dst_start.py +97 -0
  66. ipgeolocation/models/timezone_airport.py +109 -0
  67. ipgeolocation/models/timezone_detail.py +133 -0
  68. ipgeolocation/models/timezone_detail_dst_end.py +97 -0
  69. ipgeolocation/models/timezone_detail_dst_start.py +97 -0
  70. ipgeolocation/models/timezone_location.py +117 -0
  71. ipgeolocation/models/timezone_locode.py +101 -0
  72. ipgeolocation/models/user_agent_data.py +113 -0
  73. ipgeolocation/models/user_agent_data_device.py +93 -0
  74. ipgeolocation/models/user_agent_data_engine.py +93 -0
  75. ipgeolocation/models/user_agent_data_operating_system.py +95 -0
  76. ipgeolocation/models/user_agent_xml_data.py +113 -0
  77. ipgeolocation/models/user_agent_xml_data_array.py +113 -0
  78. ipgeolocation/py.typed +0 -0
  79. ipgeolocation/rest.py +258 -0
  80. ipgeolocationio-1.0.0.dist-info/METADATA +1722 -0
  81. ipgeolocationio-1.0.0.dist-info/RECORD +84 -0
  82. ipgeolocationio-1.0.0.dist-info/WHEEL +5 -0
  83. ipgeolocationio-1.0.0.dist-info/licenses/LICENSE +201 -0
  84. ipgeolocationio-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,102 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ IPGeolocation.io - IP intelligence products
7
+
8
+ Ipgeolocation provides a set of APIs to make ip based decisions.
9
+
10
+ Creat a free account by signing up here:
11
+ https://app.ipgeolocation.io/signup
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 ipgeolocation.api.asn_lookup_api import ASNLookupApi
21
+ from ipgeolocation.api.abuse_contact_api import AbuseContactApi
22
+ from ipgeolocation.api.astronomy_api import AstronomyApi
23
+ from ipgeolocation.api.ipgeolocation_api import IPGeolocationApi
24
+ from ipgeolocation.api.ip_security_api import IPSecurityApi
25
+ from ipgeolocation.api.time_conversion_api import TimeConversionApi
26
+ from ipgeolocation.api.timezone_api import TimezoneApi
27
+ from ipgeolocation.api.user_agent_api import UserAgentApi
28
+
29
+ # import ApiClient
30
+ from ipgeolocation.api_response import ApiResponse
31
+ from ipgeolocation.api_client import ApiClient
32
+ from ipgeolocation.configuration import Configuration
33
+ from ipgeolocation.exceptions import OpenApiException
34
+ from ipgeolocation.exceptions import ApiTypeError
35
+ from ipgeolocation.exceptions import ApiValueError
36
+ from ipgeolocation.exceptions import ApiKeyError
37
+ from ipgeolocation.exceptions import ApiAttributeError
38
+ from ipgeolocation.exceptions import ApiException
39
+
40
+ # import models into sdk package
41
+ from ipgeolocation.models.asn_connection import ASNConnection
42
+ from ipgeolocation.models.asn_response import ASNResponse
43
+ from ipgeolocation.models.asn_details import ASNDetails
44
+ from ipgeolocation.models.asn_response_xml import ASNResponseXML
45
+ from ipgeolocation.models.abuse import Abuse
46
+ from ipgeolocation.models.abuse_response import AbuseResponse
47
+ from ipgeolocation.models.abuse_response_xml import AbuseResponseXML
48
+ from ipgeolocation.models.astronomy import Astronomy
49
+ from ipgeolocation.models.astronomy_evening import AstronomyEvening
50
+ from ipgeolocation.models.astronomy_location import AstronomyLocation
51
+ from ipgeolocation.models.astronomy_morning import AstronomyMorning
52
+ from ipgeolocation.models.astronomy_response import AstronomyResponse
53
+ from ipgeolocation.models.astronomy_xml_response import AstronomyXMLResponse
54
+ from ipgeolocation.models.country_metadata import CountryMetadata
55
+ from ipgeolocation.models.currency import Currency
56
+ from ipgeolocation.models.error_response import ErrorResponse
57
+ from ipgeolocation.models.error_xml_response import ErrorXMLResponse
58
+ from ipgeolocation.models.error_xml_response_array import ErrorXMLResponseArray
59
+ from ipgeolocation.models.geolocation_response import GeolocationResponse
60
+ from ipgeolocation.models.geolocation_xml_response import GeolocationXMLResponse
61
+ from ipgeolocation.models.geolocation_xml_response_array import GeolocationXMLResponseArray
62
+ from ipgeolocation.models.get_bulk_ip_geolocation_response import GetBulkIpGeolocationResponse
63
+ from ipgeolocation.models.get_bulk_ip_geolocation_xml_response import GetBulkIpGeolocationXmlResponse
64
+ from ipgeolocation.models.get_bulk_ip_geolocation_request import GetBulkIpGeolocationRequest
65
+ from ipgeolocation.models.get_bulk_ip_security_info_response import GetBulkIpSecurityInfoResponse
66
+ from ipgeolocation.models.get_bulk_ip_security_info_xml_response import GetBulkIpSecurityInfoXmlResponse
67
+ from ipgeolocation.models.location import Location
68
+ from ipgeolocation.models.location_minimal import LocationMinimal
69
+ from ipgeolocation.models.network import Network
70
+ from ipgeolocation.models.network_asn import NetworkAsn
71
+ from ipgeolocation.models.network_company import NetworkCompany
72
+ from ipgeolocation.models.network_minimal import NetworkMinimal
73
+ from ipgeolocation.models.network_minimal_asn import NetworkMinimalAsn
74
+ from ipgeolocation.models.network_minimal_company import NetworkMinimalCompany
75
+ from ipgeolocation.models.parse_bulk_user_agent_strings_request import ParseBulkUserAgentStringsRequest
76
+ from ipgeolocation.models.parse_user_agent_string_request import ParseUserAgentStringRequest
77
+ from ipgeolocation.models.security import Security
78
+ from ipgeolocation.models.ip_security_api_response import IPSecurityAPIResponse
79
+ from ipgeolocation.models.ip_security_api_xml_response import IPSecurityAPIXMLResponse
80
+ from ipgeolocation.models.ip_security_api_xml_response_array import IPSecurityAPIXMLResponseArray
81
+ from ipgeolocation.models.time_conversion_response import TimeConversionResponse
82
+ from ipgeolocation.models.time_conversion_xml_response import TimeConversionXMLResponse
83
+ from ipgeolocation.models.time_series import TimeSeries
84
+ from ipgeolocation.models.time_series_response import TimeSeriesResponse
85
+ from ipgeolocation.models.time_series_xml_response import TimeSeriesXmlResponse
86
+ from ipgeolocation.models.time_zone import TimeZone
87
+ from ipgeolocation.models.time_zone_detailed_response import TimeZoneDetailedResponse
88
+ from ipgeolocation.models.time_zone_detailed_xml_response import TimeZoneDetailedXMLResponse
89
+ from ipgeolocation.models.time_zone_dst_end import TimeZoneDstEnd
90
+ from ipgeolocation.models.time_zone_dst_start import TimeZoneDstStart
91
+ from ipgeolocation.models.timezone_airport import TimezoneAirport
92
+ from ipgeolocation.models.timezone_detail import TimezoneDetail
93
+ from ipgeolocation.models.timezone_detail_dst_end import TimezoneDetailDstEnd
94
+ from ipgeolocation.models.timezone_detail_dst_start import TimezoneDetailDstStart
95
+ from ipgeolocation.models.timezone_location import TimezoneLocation
96
+ from ipgeolocation.models.timezone_locode import TimezoneLocode
97
+ from ipgeolocation.models.user_agent_data import UserAgentData
98
+ from ipgeolocation.models.user_agent_data_device import UserAgentDataDevice
99
+ from ipgeolocation.models.user_agent_data_engine import UserAgentDataEngine
100
+ from ipgeolocation.models.user_agent_data_operating_system import UserAgentDataOperatingSystem
101
+ from ipgeolocation.models.user_agent_xml_data import UserAgentXMLData
102
+ from ipgeolocation.models.user_agent_xml_data_array import UserAgentXMLDataArray
@@ -0,0 +1,12 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from ipgeolocation.api.asn_lookup_api import ASNLookupApi
5
+ from ipgeolocation.api.abuse_contact_api import AbuseContactApi
6
+ from ipgeolocation.api.astronomy_api import AstronomyApi
7
+ from ipgeolocation.api.ipgeolocation_api import IPGeolocationApi
8
+ from ipgeolocation.api.ip_security_api import IPSecurityApi
9
+ from ipgeolocation.api.time_conversion_api import TimeConversionApi
10
+ from ipgeolocation.api.timezone_api import TimezoneApi
11
+ from ipgeolocation.api.user_agent_api import UserAgentApi
12
+
@@ -0,0 +1,358 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ IPGeolocation.io - IP intelligence products
5
+
6
+ Ipgeolocation provides a set of APIs to make ip based decisions.
7
+
8
+ Creat a free account by signing up here:
9
+ https://app.ipgeolocation.io/signup
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictStr
20
+ from typing import Optional
21
+ from typing_extensions import Annotated
22
+ from ipgeolocation.models.abuse_response import AbuseResponse
23
+
24
+ from ipgeolocation.api_client import ApiClient, RequestSerialized
25
+ from ipgeolocation.api_response import ApiResponse
26
+ from ipgeolocation.rest import RESTResponseType
27
+
28
+
29
+ class AbuseContactApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+
42
+ @validate_call
43
+ def get_abuse_contact_info(
44
+ self,
45
+ ip: Annotated[Optional[StrictStr], Field(description="query parameter 'ip'.")] = None,
46
+ excludes: Annotated[Optional[StrictStr], Field(description="You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove emails and handle from api response, you can put the keys in excludes parameter like this.")] = None,
47
+ fields: Annotated[Optional[StrictStr], Field(description="You can customize the API response by using the fields parameter to include only the specific data you need. For example, to retrieve only the role and emails, specify these keys in the fields parameter as shown below.")] = None,
48
+ _request_timeout: Union[
49
+ None,
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Tuple[
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Annotated[StrictFloat, Field(gt=0)]
54
+ ]
55
+ ] = None,
56
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
57
+ _content_type: Optional[StrictStr] = None,
58
+ _headers: Optional[Dict[StrictStr, Any]] = None,
59
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
60
+ ) -> AbuseResponse:
61
+ """get_abuse_contact_info
62
+
63
+ The Abuse Contact API provides essential contact information to report abusive activity associated with IP addresses. By querying an IP address (IPv4 or IPv6), users receive detailed abuse contact data, including the responsible organization, abuse handling role, contact emails, phone numbers, and registered address. This enables users to swiftly take action to report and mitigate threats such as spam, DDoS attacks, and phishing. In addition to abuse-specific contacts, the API also includes registration metadata like the registered country and abuse handle. This empowers cybersecurity teams, hosting providers, and compliance entities to take appropriate legal or administrative action.
64
+
65
+ :param ip: query parameter 'ip'.
66
+ :type ip: str
67
+ :param excludes: You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove emails and handle from api response, you can put the keys in excludes parameter like this.
68
+ :type excludes: str
69
+ :param fields: You can customize the API response by using the fields parameter to include only the specific data you need. For example, to retrieve only the role and emails, specify these keys in the fields parameter as shown below.
70
+ :type fields: str
71
+ :param _request_timeout: timeout setting for this request. If one
72
+ number provided, it will be total request
73
+ timeout. It can also be a pair (tuple) of
74
+ (connection, read) timeouts.
75
+ :type _request_timeout: int, tuple(int, int), optional
76
+ :param _request_auth: set to override the auth_settings for an a single
77
+ request; this effectively ignores the
78
+ authentication in the spec for a single request.
79
+ :type _request_auth: dict, optional
80
+ :param _content_type: force content-type for the request.
81
+ :type _content_type: str, Optional
82
+ :param _headers: set to override the headers for a single
83
+ request; this effectively ignores the headers
84
+ in the spec for a single request.
85
+ :type _headers: dict, optional
86
+ :param _host_index: set to override the host_index for a single
87
+ request; this effectively ignores the host_index
88
+ in the spec for a single request.
89
+ :type _host_index: int, optional
90
+ :return: Returns the result object.
91
+ """ # noqa: E501
92
+
93
+ _param = self._get_abuse_contact_info_serialize(
94
+ ip=ip,
95
+ excludes=excludes,
96
+ fields=fields,
97
+ _request_auth=_request_auth,
98
+ _content_type=_content_type,
99
+ _headers=_headers,
100
+ _host_index=_host_index
101
+ )
102
+
103
+ _response_types_map: Dict[str, Optional[str]] = {
104
+ '200': "AbuseResponse",
105
+ '400': "ErrorResponse",
106
+ '401': "ErrorResponse",
107
+ '404': "ErrorResponse",
108
+ '405': "ErrorResponse",
109
+ '429': "ErrorResponse",
110
+ '499': "ErrorResponse",
111
+ '500': "ErrorResponse",
112
+ }
113
+ response_data = self.api_client.call_api(
114
+ *_param,
115
+ _request_timeout=_request_timeout
116
+ )
117
+ response_data.read()
118
+ return self.api_client.response_deserialize(
119
+ response_data=response_data,
120
+ response_types_map=_response_types_map,
121
+ ).data
122
+
123
+
124
+ @validate_call
125
+ def get_abuse_contact_info_with_http_info(
126
+ self,
127
+ ip: Annotated[Optional[StrictStr], Field(description="query parameter 'ip'.")] = None,
128
+ excludes: Annotated[Optional[StrictStr], Field(description="You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove emails and handle from api response, you can put the keys in excludes parameter like this.")] = None,
129
+ fields: Annotated[Optional[StrictStr], Field(description="You can customize the API response by using the fields parameter to include only the specific data you need. For example, to retrieve only the role and emails, specify these keys in the fields parameter as shown below.")] = None,
130
+ _request_timeout: Union[
131
+ None,
132
+ Annotated[StrictFloat, Field(gt=0)],
133
+ Tuple[
134
+ Annotated[StrictFloat, Field(gt=0)],
135
+ Annotated[StrictFloat, Field(gt=0)]
136
+ ]
137
+ ] = None,
138
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
139
+ _content_type: Optional[StrictStr] = None,
140
+ _headers: Optional[Dict[StrictStr, Any]] = None,
141
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
142
+ ) -> ApiResponse[AbuseResponse]:
143
+ """get_abuse_contact_info
144
+
145
+ The Abuse Contact API provides essential contact information to report abusive activity associated with IP addresses. By querying an IP address (IPv4 or IPv6), users receive detailed abuse contact data, including the responsible organization, abuse handling role, contact emails, phone numbers, and registered address. This enables users to swiftly take action to report and mitigate threats such as spam, DDoS attacks, and phishing. In addition to abuse-specific contacts, the API also includes registration metadata like the registered country and abuse handle. This empowers cybersecurity teams, hosting providers, and compliance entities to take appropriate legal or administrative action.
146
+
147
+ :param ip: query parameter 'ip'.
148
+ :type ip: str
149
+ :param excludes: You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove emails and handle from api response, you can put the keys in excludes parameter like this.
150
+ :type excludes: str
151
+ :param fields: You can customize the API response by using the fields parameter to include only the specific data you need. For example, to retrieve only the role and emails, specify these keys in the fields parameter as shown below.
152
+ :type fields: str
153
+ :param _request_timeout: timeout setting for this request. If one
154
+ number provided, it will be total request
155
+ timeout. It can also be a pair (tuple) of
156
+ (connection, read) timeouts.
157
+ :type _request_timeout: int, tuple(int, int), optional
158
+ :param _request_auth: set to override the auth_settings for an a single
159
+ request; this effectively ignores the
160
+ authentication in the spec for a single request.
161
+ :type _request_auth: dict, optional
162
+ :param _content_type: force content-type for the request.
163
+ :type _content_type: str, Optional
164
+ :param _headers: set to override the headers for a single
165
+ request; this effectively ignores the headers
166
+ in the spec for a single request.
167
+ :type _headers: dict, optional
168
+ :param _host_index: set to override the host_index for a single
169
+ request; this effectively ignores the host_index
170
+ in the spec for a single request.
171
+ :type _host_index: int, optional
172
+ :return: Returns the result object.
173
+ """ # noqa: E501
174
+
175
+ _param = self._get_abuse_contact_info_serialize(
176
+ ip=ip,
177
+ excludes=excludes,
178
+ fields=fields,
179
+ _request_auth=_request_auth,
180
+ _content_type=_content_type,
181
+ _headers=_headers,
182
+ _host_index=_host_index
183
+ )
184
+
185
+ _response_types_map: Dict[str, Optional[str]] = {
186
+ '200': "AbuseResponse",
187
+ '400': "ErrorResponse",
188
+ '401': "ErrorResponse",
189
+ '404': "ErrorResponse",
190
+ '405': "ErrorResponse",
191
+ '429': "ErrorResponse",
192
+ '499': "ErrorResponse",
193
+ '500': "ErrorResponse",
194
+ }
195
+ response_data = self.api_client.call_api(
196
+ *_param,
197
+ _request_timeout=_request_timeout
198
+ )
199
+ response_data.read()
200
+ return self.api_client.response_deserialize(
201
+ response_data=response_data,
202
+ response_types_map=_response_types_map,
203
+ )
204
+
205
+
206
+ @validate_call
207
+ def get_abuse_contact_info_without_preload_content(
208
+ self,
209
+ ip: Annotated[Optional[StrictStr], Field(description="query parameter 'ip'.")] = None,
210
+ excludes: Annotated[Optional[StrictStr], Field(description="You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove emails and handle from api response, you can put the keys in excludes parameter like this.")] = None,
211
+ fields: Annotated[Optional[StrictStr], Field(description="You can customize the API response by using the fields parameter to include only the specific data you need. For example, to retrieve only the role and emails, specify these keys in the fields parameter as shown below.")] = None,
212
+ _request_timeout: Union[
213
+ None,
214
+ Annotated[StrictFloat, Field(gt=0)],
215
+ Tuple[
216
+ Annotated[StrictFloat, Field(gt=0)],
217
+ Annotated[StrictFloat, Field(gt=0)]
218
+ ]
219
+ ] = None,
220
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
221
+ _content_type: Optional[StrictStr] = None,
222
+ _headers: Optional[Dict[StrictStr, Any]] = None,
223
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
224
+ ) -> RESTResponseType:
225
+ """get_abuse_contact_info
226
+
227
+ The Abuse Contact API provides essential contact information to report abusive activity associated with IP addresses. By querying an IP address (IPv4 or IPv6), users receive detailed abuse contact data, including the responsible organization, abuse handling role, contact emails, phone numbers, and registered address. This enables users to swiftly take action to report and mitigate threats such as spam, DDoS attacks, and phishing. In addition to abuse-specific contacts, the API also includes registration metadata like the registered country and abuse handle. This empowers cybersecurity teams, hosting providers, and compliance entities to take appropriate legal or administrative action.
228
+
229
+ :param ip: query parameter 'ip'.
230
+ :type ip: str
231
+ :param excludes: You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove emails and handle from api response, you can put the keys in excludes parameter like this.
232
+ :type excludes: str
233
+ :param fields: You can customize the API response by using the fields parameter to include only the specific data you need. For example, to retrieve only the role and emails, specify these keys in the fields parameter as shown below.
234
+ :type fields: str
235
+ :param _request_timeout: timeout setting for this request. If one
236
+ number provided, it will be total request
237
+ timeout. It can also be a pair (tuple) of
238
+ (connection, read) timeouts.
239
+ :type _request_timeout: int, tuple(int, int), optional
240
+ :param _request_auth: set to override the auth_settings for an a single
241
+ request; this effectively ignores the
242
+ authentication in the spec for a single request.
243
+ :type _request_auth: dict, optional
244
+ :param _content_type: force content-type for the request.
245
+ :type _content_type: str, Optional
246
+ :param _headers: set to override the headers for a single
247
+ request; this effectively ignores the headers
248
+ in the spec for a single request.
249
+ :type _headers: dict, optional
250
+ :param _host_index: set to override the host_index for a single
251
+ request; this effectively ignores the host_index
252
+ in the spec for a single request.
253
+ :type _host_index: int, optional
254
+ :return: Returns the result object.
255
+ """ # noqa: E501
256
+
257
+ _param = self._get_abuse_contact_info_serialize(
258
+ ip=ip,
259
+ excludes=excludes,
260
+ fields=fields,
261
+ _request_auth=_request_auth,
262
+ _content_type=_content_type,
263
+ _headers=_headers,
264
+ _host_index=_host_index
265
+ )
266
+
267
+ _response_types_map: Dict[str, Optional[str]] = {
268
+ '200': "AbuseResponse",
269
+ '400': "ErrorResponse",
270
+ '401': "ErrorResponse",
271
+ '404': "ErrorResponse",
272
+ '405': "ErrorResponse",
273
+ '429': "ErrorResponse",
274
+ '499': "ErrorResponse",
275
+ '500': "ErrorResponse",
276
+ }
277
+ response_data = self.api_client.call_api(
278
+ *_param,
279
+ _request_timeout=_request_timeout
280
+ )
281
+ return response_data.response
282
+
283
+
284
+ def _get_abuse_contact_info_serialize(
285
+ self,
286
+ ip,
287
+ excludes,
288
+ fields,
289
+ _request_auth,
290
+ _content_type,
291
+ _headers,
292
+ _host_index,
293
+ ) -> RequestSerialized:
294
+
295
+ _host = None
296
+
297
+ _collection_formats: Dict[str, str] = {
298
+ }
299
+
300
+ _path_params: Dict[str, str] = {}
301
+ _query_params: List[Tuple[str, str]] = []
302
+ _header_params: Dict[str, Optional[str]] = _headers or {}
303
+ _form_params: List[Tuple[str, str]] = []
304
+ _files: Dict[
305
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
306
+ ] = {}
307
+ _body_params: Optional[bytes] = None
308
+
309
+ # process the path parameters
310
+ # process the query parameters
311
+ if ip is not None:
312
+
313
+ _query_params.append(('ip', ip))
314
+
315
+ if excludes is not None:
316
+
317
+ _query_params.append(('excludes', excludes))
318
+
319
+ if fields is not None:
320
+
321
+ _query_params.append(('fields', fields))
322
+
323
+ # process the header parameters
324
+ # process the form parameters
325
+ # process the body parameter
326
+
327
+
328
+ # set the HTTP header `Accept`
329
+ if 'Accept' not in _header_params:
330
+ _header_params['Accept'] = self.api_client.select_header_accept(
331
+ [
332
+ 'application/json',
333
+ 'application/xml'
334
+ ]
335
+ )
336
+
337
+
338
+ # authentication setting
339
+ _auth_settings: List[str] = [
340
+ 'ApiKeyAuth'
341
+ ]
342
+
343
+ return self.api_client.param_serialize(
344
+ method='GET',
345
+ resource_path='/abuse',
346
+ path_params=_path_params,
347
+ query_params=_query_params,
348
+ header_params=_header_params,
349
+ body=_body_params,
350
+ post_params=_form_params,
351
+ files=_files,
352
+ auth_settings=_auth_settings,
353
+ collection_formats=_collection_formats,
354
+ _host=_host,
355
+ _request_auth=_request_auth
356
+ )
357
+
358
+