daichodo 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.
- daichodo/__init__.py +8 -0
- daichodo/api/__init__.py +1 -0
- daichodo/api/meta/__init__.py +1 -0
- daichodo/api/meta/health.py +124 -0
- daichodo/api/registry/__init__.py +1 -0
- daichodo/api/registry/get_corporation.py +169 -0
- daichodo/api/registry/get_invoice_issuer.py +177 -0
- daichodo/api/registry/get_validity.py +208 -0
- daichodo/api/validation/__init__.py +1 -0
- daichodo/api/validation/validate.py +178 -0
- daichodo/client.py +268 -0
- daichodo/errors.py +16 -0
- daichodo/models/__init__.py +23 -0
- daichodo/models/corporation.py +274 -0
- daichodo/models/health.py +69 -0
- daichodo/models/http_validation_error.py +79 -0
- daichodo/models/invoice_issuer.py +326 -0
- daichodo/models/validate_request.py +62 -0
- daichodo/models/validate_response.py +75 -0
- daichodo/models/validation_error.py +90 -0
- daichodo/models/validation_item.py +114 -0
- daichodo/models/validity_response.py +148 -0
- daichodo/py.typed +1 -0
- daichodo/types.py +54 -0
- daichodo-0.1.0.dist-info/METADATA +73 -0
- daichodo-0.1.0.dist-info/RECORD +28 -0
- daichodo-0.1.0.dist-info/WHEEL +4 -0
- daichodo-0.1.0.dist-info/entry_points.txt +4 -0
daichodo/__init__.py
ADDED
daichodo/api/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.health import Health
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
|
|
14
|
+
_kwargs: dict[str, Any] = {
|
|
15
|
+
"method": "get",
|
|
16
|
+
"url": "/v1/health",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return _kwargs
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Health | None:
|
|
23
|
+
if response.status_code == 200:
|
|
24
|
+
response_200 = Health.from_dict(response.json())
|
|
25
|
+
|
|
26
|
+
return response_200
|
|
27
|
+
|
|
28
|
+
if client.raise_on_unexpected_status:
|
|
29
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
30
|
+
else:
|
|
31
|
+
return None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Health]:
|
|
35
|
+
return Response(
|
|
36
|
+
status_code=HTTPStatus(response.status_code),
|
|
37
|
+
content=response.content,
|
|
38
|
+
headers=response.headers,
|
|
39
|
+
parsed=_parse_response(client=client, response=response),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def sync_detailed(
|
|
44
|
+
*,
|
|
45
|
+
client: AuthenticatedClient | Client,
|
|
46
|
+
) -> Response[Health]:
|
|
47
|
+
"""Liveness check
|
|
48
|
+
|
|
49
|
+
Raises:
|
|
50
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
51
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
Response[Health]
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
kwargs = _get_kwargs()
|
|
58
|
+
|
|
59
|
+
response = client.get_httpx_client().request(
|
|
60
|
+
**kwargs,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
return _build_response(client=client, response=response)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def sync(
|
|
67
|
+
*,
|
|
68
|
+
client: AuthenticatedClient | Client,
|
|
69
|
+
) -> Health | None:
|
|
70
|
+
"""Liveness check
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
74
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
Health
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
return sync_detailed(
|
|
81
|
+
client=client,
|
|
82
|
+
).parsed
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
async def asyncio_detailed(
|
|
86
|
+
*,
|
|
87
|
+
client: AuthenticatedClient | Client,
|
|
88
|
+
) -> Response[Health]:
|
|
89
|
+
"""Liveness check
|
|
90
|
+
|
|
91
|
+
Raises:
|
|
92
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
93
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
Response[Health]
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
kwargs = _get_kwargs()
|
|
100
|
+
|
|
101
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
102
|
+
|
|
103
|
+
return _build_response(client=client, response=response)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
async def asyncio(
|
|
107
|
+
*,
|
|
108
|
+
client: AuthenticatedClient | Client,
|
|
109
|
+
) -> Health | None:
|
|
110
|
+
"""Liveness check
|
|
111
|
+
|
|
112
|
+
Raises:
|
|
113
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
114
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
Health
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
await asyncio_detailed(
|
|
122
|
+
client=client,
|
|
123
|
+
)
|
|
124
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.corporation import Corporation
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
corporate_number: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "get",
|
|
20
|
+
"url": "/v1/corporations/{corporate_number}".format(
|
|
21
|
+
corporate_number=quote(str(corporate_number), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(
|
|
29
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
30
|
+
) -> Corporation | HTTPValidationError | None:
|
|
31
|
+
if response.status_code == 200:
|
|
32
|
+
response_200 = Corporation.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_200
|
|
35
|
+
|
|
36
|
+
if response.status_code == 422:
|
|
37
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_422
|
|
40
|
+
|
|
41
|
+
if client.raise_on_unexpected_status:
|
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
43
|
+
else:
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(
|
|
48
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
49
|
+
) -> Response[Corporation | HTTPValidationError]:
|
|
50
|
+
return Response(
|
|
51
|
+
status_code=HTTPStatus(response.status_code),
|
|
52
|
+
content=response.content,
|
|
53
|
+
headers=response.headers,
|
|
54
|
+
parsed=_parse_response(client=client, response=response),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def sync_detailed(
|
|
59
|
+
corporate_number: str,
|
|
60
|
+
*,
|
|
61
|
+
client: AuthenticatedClient | Client,
|
|
62
|
+
) -> Response[Corporation | HTTPValidationError]:
|
|
63
|
+
"""Look up a corporate number
|
|
64
|
+
|
|
65
|
+
Current published information for a 法人番号. Counts against your quota.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
corporate_number (str):
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
72
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
Response[Corporation | HTTPValidationError]
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
kwargs = _get_kwargs(
|
|
79
|
+
corporate_number=corporate_number,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
response = client.get_httpx_client().request(
|
|
83
|
+
**kwargs,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
return _build_response(client=client, response=response)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def sync(
|
|
90
|
+
corporate_number: str,
|
|
91
|
+
*,
|
|
92
|
+
client: AuthenticatedClient | Client,
|
|
93
|
+
) -> Corporation | HTTPValidationError | None:
|
|
94
|
+
"""Look up a corporate number
|
|
95
|
+
|
|
96
|
+
Current published information for a 法人番号. Counts against your quota.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
corporate_number (str):
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
103
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
Corporation | HTTPValidationError
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
return sync_detailed(
|
|
110
|
+
corporate_number=corporate_number,
|
|
111
|
+
client=client,
|
|
112
|
+
).parsed
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
async def asyncio_detailed(
|
|
116
|
+
corporate_number: str,
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient | Client,
|
|
119
|
+
) -> Response[Corporation | HTTPValidationError]:
|
|
120
|
+
"""Look up a corporate number
|
|
121
|
+
|
|
122
|
+
Current published information for a 法人番号. Counts against your quota.
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
corporate_number (str):
|
|
126
|
+
|
|
127
|
+
Raises:
|
|
128
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
129
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
Response[Corporation | HTTPValidationError]
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
kwargs = _get_kwargs(
|
|
136
|
+
corporate_number=corporate_number,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
140
|
+
|
|
141
|
+
return _build_response(client=client, response=response)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
async def asyncio(
|
|
145
|
+
corporate_number: str,
|
|
146
|
+
*,
|
|
147
|
+
client: AuthenticatedClient | Client,
|
|
148
|
+
) -> Corporation | HTTPValidationError | None:
|
|
149
|
+
"""Look up a corporate number
|
|
150
|
+
|
|
151
|
+
Current published information for a 法人番号. Counts against your quota.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
corporate_number (str):
|
|
155
|
+
|
|
156
|
+
Raises:
|
|
157
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
158
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
Corporation | HTTPValidationError
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
await asyncio_detailed(
|
|
166
|
+
corporate_number=corporate_number,
|
|
167
|
+
client=client,
|
|
168
|
+
)
|
|
169
|
+
).parsed
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...models.invoice_issuer import InvoiceIssuer
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
registration_number: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "get",
|
|
20
|
+
"url": "/v1/invoice-issuers/{registration_number}".format(
|
|
21
|
+
registration_number=quote(str(registration_number), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(
|
|
29
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
30
|
+
) -> HTTPValidationError | InvoiceIssuer | None:
|
|
31
|
+
if response.status_code == 200:
|
|
32
|
+
response_200 = InvoiceIssuer.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_200
|
|
35
|
+
|
|
36
|
+
if response.status_code == 422:
|
|
37
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_422
|
|
40
|
+
|
|
41
|
+
if client.raise_on_unexpected_status:
|
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
43
|
+
else:
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(
|
|
48
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
49
|
+
) -> Response[HTTPValidationError | InvoiceIssuer]:
|
|
50
|
+
return Response(
|
|
51
|
+
status_code=HTTPStatus(response.status_code),
|
|
52
|
+
content=response.content,
|
|
53
|
+
headers=response.headers,
|
|
54
|
+
parsed=_parse_response(client=client, response=response),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def sync_detailed(
|
|
59
|
+
registration_number: str,
|
|
60
|
+
*,
|
|
61
|
+
client: AuthenticatedClient | Client,
|
|
62
|
+
) -> Response[HTTPValidationError | InvoiceIssuer]:
|
|
63
|
+
"""Look up a qualified invoice issuer
|
|
64
|
+
|
|
65
|
+
Current published information for a 登録番号. Counts against your monthly quota.
|
|
66
|
+
|
|
67
|
+
Sole traders return dates with a null `name` - that is a valid record, not a miss.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
registration_number (str):
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
74
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
Response[HTTPValidationError | InvoiceIssuer]
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
kwargs = _get_kwargs(
|
|
81
|
+
registration_number=registration_number,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
response = client.get_httpx_client().request(
|
|
85
|
+
**kwargs,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
return _build_response(client=client, response=response)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync(
|
|
92
|
+
registration_number: str,
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient | Client,
|
|
95
|
+
) -> HTTPValidationError | InvoiceIssuer | None:
|
|
96
|
+
"""Look up a qualified invoice issuer
|
|
97
|
+
|
|
98
|
+
Current published information for a 登録番号. Counts against your monthly quota.
|
|
99
|
+
|
|
100
|
+
Sole traders return dates with a null `name` - that is a valid record, not a miss.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
registration_number (str):
|
|
104
|
+
|
|
105
|
+
Raises:
|
|
106
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
107
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
HTTPValidationError | InvoiceIssuer
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
return sync_detailed(
|
|
114
|
+
registration_number=registration_number,
|
|
115
|
+
client=client,
|
|
116
|
+
).parsed
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
async def asyncio_detailed(
|
|
120
|
+
registration_number: str,
|
|
121
|
+
*,
|
|
122
|
+
client: AuthenticatedClient | Client,
|
|
123
|
+
) -> Response[HTTPValidationError | InvoiceIssuer]:
|
|
124
|
+
"""Look up a qualified invoice issuer
|
|
125
|
+
|
|
126
|
+
Current published information for a 登録番号. Counts against your monthly quota.
|
|
127
|
+
|
|
128
|
+
Sole traders return dates with a null `name` - that is a valid record, not a miss.
|
|
129
|
+
|
|
130
|
+
Args:
|
|
131
|
+
registration_number (str):
|
|
132
|
+
|
|
133
|
+
Raises:
|
|
134
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
135
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
136
|
+
|
|
137
|
+
Returns:
|
|
138
|
+
Response[HTTPValidationError | InvoiceIssuer]
|
|
139
|
+
"""
|
|
140
|
+
|
|
141
|
+
kwargs = _get_kwargs(
|
|
142
|
+
registration_number=registration_number,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
146
|
+
|
|
147
|
+
return _build_response(client=client, response=response)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
async def asyncio(
|
|
151
|
+
registration_number: str,
|
|
152
|
+
*,
|
|
153
|
+
client: AuthenticatedClient | Client,
|
|
154
|
+
) -> HTTPValidationError | InvoiceIssuer | None:
|
|
155
|
+
"""Look up a qualified invoice issuer
|
|
156
|
+
|
|
157
|
+
Current published information for a 登録番号. Counts against your monthly quota.
|
|
158
|
+
|
|
159
|
+
Sole traders return dates with a null `name` - that is a valid record, not a miss.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
registration_number (str):
|
|
163
|
+
|
|
164
|
+
Raises:
|
|
165
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
166
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
167
|
+
|
|
168
|
+
Returns:
|
|
169
|
+
HTTPValidationError | InvoiceIssuer
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
await asyncio_detailed(
|
|
174
|
+
registration_number=registration_number,
|
|
175
|
+
client=client,
|
|
176
|
+
)
|
|
177
|
+
).parsed
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from http import HTTPStatus
|
|
3
|
+
from typing import Any
|
|
4
|
+
from urllib.parse import quote
|
|
5
|
+
|
|
6
|
+
import httpx
|
|
7
|
+
|
|
8
|
+
from ... import errors
|
|
9
|
+
from ...client import AuthenticatedClient, Client
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...models.validity_response import ValidityResponse
|
|
12
|
+
from ...types import UNSET, Response
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
registration_number: str,
|
|
17
|
+
*,
|
|
18
|
+
on: datetime.date,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
|
|
21
|
+
params: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
json_on = on.isoformat()
|
|
24
|
+
params["on"] = json_on
|
|
25
|
+
|
|
26
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
27
|
+
|
|
28
|
+
_kwargs: dict[str, Any] = {
|
|
29
|
+
"method": "get",
|
|
30
|
+
"url": "/v1/invoice-issuers/{registration_number}/validity".format(
|
|
31
|
+
registration_number=quote(str(registration_number), safe=""),
|
|
32
|
+
),
|
|
33
|
+
"params": params,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return _kwargs
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _parse_response(
|
|
40
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
41
|
+
) -> HTTPValidationError | ValidityResponse | None:
|
|
42
|
+
if response.status_code == 200:
|
|
43
|
+
response_200 = ValidityResponse.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_200
|
|
46
|
+
|
|
47
|
+
if response.status_code == 422:
|
|
48
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_422
|
|
51
|
+
|
|
52
|
+
if client.raise_on_unexpected_status:
|
|
53
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
54
|
+
else:
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _build_response(
|
|
59
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
60
|
+
) -> Response[HTTPValidationError | ValidityResponse]:
|
|
61
|
+
return Response(
|
|
62
|
+
status_code=HTTPStatus(response.status_code),
|
|
63
|
+
content=response.content,
|
|
64
|
+
headers=response.headers,
|
|
65
|
+
parsed=_parse_response(client=client, response=response),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def sync_detailed(
|
|
70
|
+
registration_number: str,
|
|
71
|
+
*,
|
|
72
|
+
client: AuthenticatedClient | Client,
|
|
73
|
+
on: datetime.date,
|
|
74
|
+
) -> Response[HTTPValidationError | ValidityResponse]:
|
|
75
|
+
"""Was this registration valid on a given date?
|
|
76
|
+
|
|
77
|
+
Point-in-time validity, answered from the accumulated change log rather than current state - the
|
|
78
|
+
question the official sites cannot answer.
|
|
79
|
+
|
|
80
|
+
Requires a paid plan. Works for sole traders as well as corporations: individuals keep every date
|
|
81
|
+
field, only their identity is stripped.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
registration_number (str):
|
|
85
|
+
on (datetime.date): The date to test, YYYY-MM-DD
|
|
86
|
+
|
|
87
|
+
Raises:
|
|
88
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
89
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
Response[HTTPValidationError | ValidityResponse]
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
kwargs = _get_kwargs(
|
|
96
|
+
registration_number=registration_number,
|
|
97
|
+
on=on,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
response = client.get_httpx_client().request(
|
|
101
|
+
**kwargs,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
return _build_response(client=client, response=response)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def sync(
|
|
108
|
+
registration_number: str,
|
|
109
|
+
*,
|
|
110
|
+
client: AuthenticatedClient | Client,
|
|
111
|
+
on: datetime.date,
|
|
112
|
+
) -> HTTPValidationError | ValidityResponse | None:
|
|
113
|
+
"""Was this registration valid on a given date?
|
|
114
|
+
|
|
115
|
+
Point-in-time validity, answered from the accumulated change log rather than current state - the
|
|
116
|
+
question the official sites cannot answer.
|
|
117
|
+
|
|
118
|
+
Requires a paid plan. Works for sole traders as well as corporations: individuals keep every date
|
|
119
|
+
field, only their identity is stripped.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
registration_number (str):
|
|
123
|
+
on (datetime.date): The date to test, YYYY-MM-DD
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
127
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
HTTPValidationError | ValidityResponse
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
return sync_detailed(
|
|
134
|
+
registration_number=registration_number,
|
|
135
|
+
client=client,
|
|
136
|
+
on=on,
|
|
137
|
+
).parsed
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
async def asyncio_detailed(
|
|
141
|
+
registration_number: str,
|
|
142
|
+
*,
|
|
143
|
+
client: AuthenticatedClient | Client,
|
|
144
|
+
on: datetime.date,
|
|
145
|
+
) -> Response[HTTPValidationError | ValidityResponse]:
|
|
146
|
+
"""Was this registration valid on a given date?
|
|
147
|
+
|
|
148
|
+
Point-in-time validity, answered from the accumulated change log rather than current state - the
|
|
149
|
+
question the official sites cannot answer.
|
|
150
|
+
|
|
151
|
+
Requires a paid plan. Works for sole traders as well as corporations: individuals keep every date
|
|
152
|
+
field, only their identity is stripped.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
registration_number (str):
|
|
156
|
+
on (datetime.date): The date to test, YYYY-MM-DD
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
160
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
Response[HTTPValidationError | ValidityResponse]
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
kwargs = _get_kwargs(
|
|
167
|
+
registration_number=registration_number,
|
|
168
|
+
on=on,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
172
|
+
|
|
173
|
+
return _build_response(client=client, response=response)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
async def asyncio(
|
|
177
|
+
registration_number: str,
|
|
178
|
+
*,
|
|
179
|
+
client: AuthenticatedClient | Client,
|
|
180
|
+
on: datetime.date,
|
|
181
|
+
) -> HTTPValidationError | ValidityResponse | None:
|
|
182
|
+
"""Was this registration valid on a given date?
|
|
183
|
+
|
|
184
|
+
Point-in-time validity, answered from the accumulated change log rather than current state - the
|
|
185
|
+
question the official sites cannot answer.
|
|
186
|
+
|
|
187
|
+
Requires a paid plan. Works for sole traders as well as corporations: individuals keep every date
|
|
188
|
+
field, only their identity is stripped.
|
|
189
|
+
|
|
190
|
+
Args:
|
|
191
|
+
registration_number (str):
|
|
192
|
+
on (datetime.date): The date to test, YYYY-MM-DD
|
|
193
|
+
|
|
194
|
+
Raises:
|
|
195
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
196
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
197
|
+
|
|
198
|
+
Returns:
|
|
199
|
+
HTTPValidationError | ValidityResponse
|
|
200
|
+
"""
|
|
201
|
+
|
|
202
|
+
return (
|
|
203
|
+
await asyncio_detailed(
|
|
204
|
+
registration_number=registration_number,
|
|
205
|
+
client=client,
|
|
206
|
+
on=on,
|
|
207
|
+
)
|
|
208
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|