skyflow-flowvault-python 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.
- common/.coveragerc +4 -0
- common/__init__.py +3 -0
- common/client/__init__.py +0 -0
- common/client/base_skyflow.py +345 -0
- common/client/utils/__init__.py +1 -0
- common/client/utils/_utils.py +127 -0
- common/errors/__init__.py +1 -0
- common/errors/_skyflow_error.py +17 -0
- common/generated/__init__.py +0 -0
- common/generated/rest/__init__.py +24 -0
- common/generated/rest/authentication/__init__.py +4 -0
- common/generated/rest/authentication/client.py +181 -0
- common/generated/rest/authentication/raw_client.py +241 -0
- common/generated/rest/client.py +153 -0
- common/generated/rest/core/__init__.py +52 -0
- common/generated/rest/core/api_error.py +23 -0
- common/generated/rest/core/client_wrapper.py +86 -0
- common/generated/rest/core/datetime_utils.py +28 -0
- common/generated/rest/core/file.py +67 -0
- common/generated/rest/core/force_multipart.py +16 -0
- common/generated/rest/core/http_client.py +543 -0
- common/generated/rest/core/http_response.py +55 -0
- common/generated/rest/core/jsonable_encoder.py +100 -0
- common/generated/rest/core/pydantic_utilities.py +255 -0
- common/generated/rest/core/query_encoder.py +58 -0
- common/generated/rest/core/remove_none_from_dict.py +11 -0
- common/generated/rest/core/request_options.py +35 -0
- common/generated/rest/core/serialization.py +276 -0
- common/generated/rest/environment.py +8 -0
- common/generated/rest/errors/__init__.py +9 -0
- common/generated/rest/errors/bad_request_error.py +14 -0
- common/generated/rest/errors/not_found_error.py +14 -0
- common/generated/rest/errors/unauthorized_error.py +14 -0
- common/generated/rest/py.typed +0 -0
- common/generated/rest/types/__init__.py +9 -0
- common/generated/rest/types/googlerpc_status.py +22 -0
- common/generated/rest/types/protobuf_any.py +21 -0
- common/generated/rest/types/v_1_get_auth_token_response.py +33 -0
- common/generated/rest/version.py +6 -0
- common/service_account/__init__.py +1 -0
- common/service_account/_utils.py +248 -0
- common/service_account/client/__init__.py +0 -0
- common/service_account/client/auth_client.py +13 -0
- common/utils/__init__.py +4 -0
- common/utils/_helpers.py +18 -0
- common/utils/_skyflow_messages.py +445 -0
- common/utils/_utils.py +50 -0
- common/utils/constants.py +291 -0
- common/utils/enums/__init__.py +12 -0
- common/utils/enums/content_types.py +9 -0
- common/utils/enums/detect_entities.py +73 -0
- common/utils/enums/detect_output_transcriptions.py +8 -0
- common/utils/enums/env.py +13 -0
- common/utils/enums/log_level.py +8 -0
- common/utils/enums/masking_method.py +5 -0
- common/utils/enums/redaction_type.py +7 -0
- common/utils/enums/request_method.py +8 -0
- common/utils/enums/token_mode.py +6 -0
- common/utils/enums/token_type.py +6 -0
- common/utils/logger/__init__.py +2 -0
- common/utils/logger/_log_helpers.py +47 -0
- common/utils/logger/_logger.py +50 -0
- common/utils/validations/__init__.py +11 -0
- common/utils/validations/_validations.py +267 -0
- common/vault/base_vault_client.py +122 -0
- common/vault/base_vault_controller.py +58 -0
- common/vault/data/__init__.py +2 -0
- common/vault/data/_base_insert_request.py +7 -0
- common/vault/data/_base_insert_response.py +11 -0
- skyflow/__init__.py +2 -0
- skyflow/client/__init__.py +1 -0
- skyflow/client/_http_config_builder.py +45 -0
- skyflow/client/skyflow.py +15 -0
- skyflow/error/__init__.py +3 -0
- skyflow/generated/__init__.py +0 -0
- skyflow/generated/rest/__init__.py +164 -0
- skyflow/generated/rest/_default_clients.py +32 -0
- skyflow/generated/rest/client.py +385 -0
- skyflow/generated/rest/core/__init__.py +127 -0
- skyflow/generated/rest/core/api_error.py +23 -0
- skyflow/generated/rest/core/client_wrapper.py +148 -0
- skyflow/generated/rest/core/datetime_utils.py +70 -0
- skyflow/generated/rest/core/file.py +67 -0
- skyflow/generated/rest/core/force_multipart.py +18 -0
- skyflow/generated/rest/core/http_client.py +940 -0
- skyflow/generated/rest/core/http_response.py +63 -0
- skyflow/generated/rest/core/http_sse/__init__.py +42 -0
- skyflow/generated/rest/core/http_sse/_api.py +455 -0
- skyflow/generated/rest/core/http_sse/_decoders.py +74 -0
- skyflow/generated/rest/core/http_sse/_exceptions.py +7 -0
- skyflow/generated/rest/core/http_sse/_models.py +17 -0
- skyflow/generated/rest/core/jsonable_encoder.py +133 -0
- skyflow/generated/rest/core/logging.py +107 -0
- skyflow/generated/rest/core/parse_error.py +36 -0
- skyflow/generated/rest/core/pydantic_utilities.py +486 -0
- skyflow/generated/rest/core/query_encoder.py +58 -0
- skyflow/generated/rest/core/remove_none_from_dict.py +11 -0
- skyflow/generated/rest/core/request_options.py +40 -0
- skyflow/generated/rest/core/serialization.py +347 -0
- skyflow/generated/rest/environment.py +8 -0
- skyflow/generated/rest/errors/__init__.py +53 -0
- skyflow/generated/rest/errors/bad_request_error.py +11 -0
- skyflow/generated/rest/errors/forbidden_error.py +11 -0
- skyflow/generated/rest/errors/internal_server_error.py +11 -0
- skyflow/generated/rest/errors/not_found_error.py +11 -0
- skyflow/generated/rest/errors/too_many_requests_error.py +11 -0
- skyflow/generated/rest/errors/unauthorized_error.py +11 -0
- skyflow/generated/rest/py.typed +0 -0
- skyflow/generated/rest/query/__init__.py +4 -0
- skyflow/generated/rest/query/client.py +139 -0
- skyflow/generated/rest/query/raw_client.py +239 -0
- skyflow/generated/rest/raw_client.py +86 -0
- skyflow/generated/rest/records/__init__.py +34 -0
- skyflow/generated/rest/records/client.py +685 -0
- skyflow/generated/rest/records/raw_client.py +988 -0
- skyflow/generated/rest/records/types/__init__.py +34 -0
- skyflow/generated/rest/records/types/update_request_update_type.py +5 -0
- skyflow/generated/rest/tokens/__init__.py +4 -0
- skyflow/generated/rest/tokens/client.py +246 -0
- skyflow/generated/rest/tokens/raw_client.py +507 -0
- skyflow/generated/rest/types/__init__.py +116 -0
- skyflow/generated/rest/types/column_redactions.py +33 -0
- skyflow/generated/rest/types/delete_response.py +23 -0
- skyflow/generated/rest/types/delete_response_object.py +42 -0
- skyflow/generated/rest/types/detokenize_response.py +23 -0
- skyflow/generated/rest/types/detokenize_response_object.py +54 -0
- skyflow/generated/rest/types/error_response.py +20 -0
- skyflow/generated/rest/types/error_response_error.py +28 -0
- skyflow/generated/rest/types/execute_query_record_response.py +22 -0
- skyflow/generated/rest/types/execute_query_response.py +26 -0
- skyflow/generated/rest/types/execute_query_response_metadata.py +26 -0
- skyflow/generated/rest/types/get_request_data.py +60 -0
- skyflow/generated/rest/types/get_response.py +23 -0
- skyflow/generated/rest/types/get_tokens_from_values_request_object.py +30 -0
- skyflow/generated/rest/types/get_tokens_from_values_response.py +23 -0
- skyflow/generated/rest/types/google_protobuf_value.py +8 -0
- skyflow/generated/rest/types/http_code.py +6 -0
- skyflow/generated/rest/types/insert_record_data.py +36 -0
- skyflow/generated/rest/types/insert_response.py +23 -0
- skyflow/generated/rest/types/record_response_object.py +70 -0
- skyflow/generated/rest/types/token_group_redactions.py +33 -0
- skyflow/generated/rest/types/tokenize_response_object.py +49 -0
- skyflow/generated/rest/types/unique_value.py +22 -0
- skyflow/generated/rest/types/update_record_data.py +52 -0
- skyflow/generated/rest/types/update_record_data_update_type.py +5 -0
- skyflow/generated/rest/types/update_response.py +23 -0
- skyflow/generated/rest/types/upsert.py +45 -0
- skyflow/generated/rest/types/upsert_update_type.py +5 -0
- skyflow/generated/rest/version.py +6 -0
- skyflow/service_account/__init__.py +15 -0
- skyflow/utils/__init__.py +9 -0
- skyflow/utils/_http_config.py +36 -0
- skyflow/utils/_response_parsing.py +66 -0
- skyflow/utils/_retry.py +97 -0
- skyflow/utils/_skyflow_messages.py +114 -0
- skyflow/utils/_utils.py +54 -0
- skyflow/utils/_version.py +1 -0
- skyflow/utils/enums/__init__.py +3 -0
- skyflow/utils/enums/_custom_header_key.py +10 -0
- skyflow/utils/enums/_env_urls.py +9 -0
- skyflow/utils/enums/_upsert_type.py +7 -0
- skyflow/utils/validations/__init__.py +9 -0
- skyflow/utils/validations/_validations.py +195 -0
- skyflow/vault/__init__.py +0 -0
- skyflow/vault/client/__init__.py +0 -0
- skyflow/vault/client/client.py +102 -0
- skyflow/vault/controller/__init__.py +1 -0
- skyflow/vault/controller/_vault.py +475 -0
- skyflow/vault/data/__init__.py +30 -0
- skyflow/vault/data/_column_redactions.py +4 -0
- skyflow/vault/data/_delete_options.py +8 -0
- skyflow/vault/data/_delete_request.py +5 -0
- skyflow/vault/data/_delete_response.py +9 -0
- skyflow/vault/data/_delete_response_record.py +9 -0
- skyflow/vault/data/_detokenize_options.py +8 -0
- skyflow/vault/data/_detokenize_request.py +9 -0
- skyflow/vault/data/_detokenize_response.py +9 -0
- skyflow/vault/data/_detokenize_response_record.py +16 -0
- skyflow/vault/data/_detokenize_response_record_metadata.py +10 -0
- skyflow/vault/data/_get_options.py +8 -0
- skyflow/vault/data/_get_request.py +17 -0
- skyflow/vault/data/_get_request_record.py +13 -0
- skyflow/vault/data/_get_response.py +9 -0
- skyflow/vault/data/_get_response_record.py +17 -0
- skyflow/vault/data/_insert_options.py +8 -0
- skyflow/vault/data/_insert_request.py +11 -0
- skyflow/vault/data/_insert_request_record.py +9 -0
- skyflow/vault/data/_insert_response.py +9 -0
- skyflow/vault/data/_insert_response_record.py +17 -0
- skyflow/vault/data/_request_context.py +16 -0
- skyflow/vault/data/_token.py +8 -0
- skyflow/vault/data/_token_group_redactions.py +4 -0
- skyflow/vault/data/_update_options.py +8 -0
- skyflow/vault/data/_update_request.py +11 -0
- skyflow/vault/data/_update_request_record.py +6 -0
- skyflow/vault/data/_update_response.py +9 -0
- skyflow/vault/data/_update_response_record.py +17 -0
- skyflow/vault/data/_upsert_options.py +7 -0
- skyflow_flowvault_python-1.0.0.dist-info/METADATA +896 -0
- skyflow_flowvault_python-1.0.0.dist-info/RECORD +202 -0
- skyflow_flowvault_python-1.0.0.dist-info/WHEEL +5 -0
- skyflow_flowvault_python-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.v_1_get_auth_token_response import V1GetAuthTokenResponse
|
|
8
|
+
from .raw_client import AsyncRawAuthenticationClient, RawAuthenticationClient
|
|
9
|
+
|
|
10
|
+
# this is used as the default value for optional parameters
|
|
11
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AuthenticationClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._raw_client = RawAuthenticationClient(client_wrapper=client_wrapper)
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def with_raw_response(self) -> RawAuthenticationClient:
|
|
20
|
+
"""
|
|
21
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
22
|
+
|
|
23
|
+
Returns
|
|
24
|
+
-------
|
|
25
|
+
RawAuthenticationClient
|
|
26
|
+
"""
|
|
27
|
+
return self._raw_client
|
|
28
|
+
|
|
29
|
+
def authentication_service_get_auth_token(
|
|
30
|
+
self,
|
|
31
|
+
*,
|
|
32
|
+
grant_type: str,
|
|
33
|
+
assertion: str,
|
|
34
|
+
subject_token: typing.Optional[str] = OMIT,
|
|
35
|
+
subject_token_type: typing.Optional[str] = OMIT,
|
|
36
|
+
requested_token_use: typing.Optional[str] = OMIT,
|
|
37
|
+
scope: typing.Optional[str] = OMIT,
|
|
38
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
39
|
+
) -> V1GetAuthTokenResponse:
|
|
40
|
+
"""
|
|
41
|
+
<p>Generates a Bearer Token to authenticate with Skyflow. This method doesn't require the <code>Authorization</code> header.</p><p><b>Note:</b> For recommended ways to authenticate, see <a href='/api-authentication/'>API authentication</a>.</p>
|
|
42
|
+
|
|
43
|
+
Parameters
|
|
44
|
+
----------
|
|
45
|
+
grant_type : str
|
|
46
|
+
Grant type of the request. Set this to `urn:ietf:params:oauth:grant-type:jwt-bearer`.
|
|
47
|
+
|
|
48
|
+
assertion : str
|
|
49
|
+
User-signed JWT token that contains the following fields: <br/> <ul><li><code>iss</code>: Issuer of the JWT.</li><li><code>key</code>: Unique identifier for the key.</li><li><code>aud</code>: Recipient the JWT is intended for.</li><li><code>exp</code>: Time the JWT expires.</li><li><code>sub</code>: Subject of the JWT.</li><li><code>ctx</code>: (Optional) Value for <a href='/context-aware-overview/'>Context-aware authorization</a>.</li></ul>
|
|
50
|
+
|
|
51
|
+
subject_token : typing.Optional[str]
|
|
52
|
+
Subject token.
|
|
53
|
+
|
|
54
|
+
subject_token_type : typing.Optional[str]
|
|
55
|
+
Subject token type.
|
|
56
|
+
|
|
57
|
+
requested_token_use : typing.Optional[str]
|
|
58
|
+
Token use type. Either `delegation` or `impersonation`.
|
|
59
|
+
|
|
60
|
+
scope : typing.Optional[str]
|
|
61
|
+
Subset of available <a href='#Roles'>roles</a> to associate with the requested token. Uses the format "role:\<roleID1\> role:\<roleID2\>".
|
|
62
|
+
|
|
63
|
+
request_options : typing.Optional[RequestOptions]
|
|
64
|
+
Request-specific configuration.
|
|
65
|
+
|
|
66
|
+
Returns
|
|
67
|
+
-------
|
|
68
|
+
V1GetAuthTokenResponse
|
|
69
|
+
A successful response.
|
|
70
|
+
|
|
71
|
+
Examples
|
|
72
|
+
--------
|
|
73
|
+
from skyflow import SkyflowAuth
|
|
74
|
+
|
|
75
|
+
client = SkyflowAuth(
|
|
76
|
+
token="YOUR_TOKEN",
|
|
77
|
+
)
|
|
78
|
+
client.authentication.authentication_service_get_auth_token(
|
|
79
|
+
grant_type="urn:ietf:params:oauth:grant-type:jwt-bearer",
|
|
80
|
+
assertion="eyLhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaXNzIjoiY29tcGFueSIsImV4cCI6MTYxNTE5MzgwNywiaWF0IjoxNjE1MTY1MDQwLCJhdWQiOiKzb21lYXVkaWVuY2UifQ.4pcPyMDQ9o1PSyXnrXCjTwXyr4BSezdI1AVTmud2fU3",
|
|
81
|
+
)
|
|
82
|
+
"""
|
|
83
|
+
_response = self._raw_client.authentication_service_get_auth_token(
|
|
84
|
+
grant_type=grant_type,
|
|
85
|
+
assertion=assertion,
|
|
86
|
+
subject_token=subject_token,
|
|
87
|
+
subject_token_type=subject_token_type,
|
|
88
|
+
requested_token_use=requested_token_use,
|
|
89
|
+
scope=scope,
|
|
90
|
+
request_options=request_options,
|
|
91
|
+
)
|
|
92
|
+
return _response.data
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class AsyncAuthenticationClient:
|
|
96
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
97
|
+
self._raw_client = AsyncRawAuthenticationClient(client_wrapper=client_wrapper)
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def with_raw_response(self) -> AsyncRawAuthenticationClient:
|
|
101
|
+
"""
|
|
102
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
103
|
+
|
|
104
|
+
Returns
|
|
105
|
+
-------
|
|
106
|
+
AsyncRawAuthenticationClient
|
|
107
|
+
"""
|
|
108
|
+
return self._raw_client
|
|
109
|
+
|
|
110
|
+
async def authentication_service_get_auth_token(
|
|
111
|
+
self,
|
|
112
|
+
*,
|
|
113
|
+
grant_type: str,
|
|
114
|
+
assertion: str,
|
|
115
|
+
subject_token: typing.Optional[str] = OMIT,
|
|
116
|
+
subject_token_type: typing.Optional[str] = OMIT,
|
|
117
|
+
requested_token_use: typing.Optional[str] = OMIT,
|
|
118
|
+
scope: typing.Optional[str] = OMIT,
|
|
119
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
120
|
+
) -> V1GetAuthTokenResponse:
|
|
121
|
+
"""
|
|
122
|
+
<p>Generates a Bearer Token to authenticate with Skyflow. This method doesn't require the <code>Authorization</code> header.</p><p><b>Note:</b> For recommended ways to authenticate, see <a href='/api-authentication/'>API authentication</a>.</p>
|
|
123
|
+
|
|
124
|
+
Parameters
|
|
125
|
+
----------
|
|
126
|
+
grant_type : str
|
|
127
|
+
Grant type of the request. Set this to `urn:ietf:params:oauth:grant-type:jwt-bearer`.
|
|
128
|
+
|
|
129
|
+
assertion : str
|
|
130
|
+
User-signed JWT token that contains the following fields: <br/> <ul><li><code>iss</code>: Issuer of the JWT.</li><li><code>key</code>: Unique identifier for the key.</li><li><code>aud</code>: Recipient the JWT is intended for.</li><li><code>exp</code>: Time the JWT expires.</li><li><code>sub</code>: Subject of the JWT.</li><li><code>ctx</code>: (Optional) Value for <a href='/context-aware-overview/'>Context-aware authorization</a>.</li></ul>
|
|
131
|
+
|
|
132
|
+
subject_token : typing.Optional[str]
|
|
133
|
+
Subject token.
|
|
134
|
+
|
|
135
|
+
subject_token_type : typing.Optional[str]
|
|
136
|
+
Subject token type.
|
|
137
|
+
|
|
138
|
+
requested_token_use : typing.Optional[str]
|
|
139
|
+
Token use type. Either `delegation` or `impersonation`.
|
|
140
|
+
|
|
141
|
+
scope : typing.Optional[str]
|
|
142
|
+
Subset of available <a href='#Roles'>roles</a> to associate with the requested token. Uses the format "role:\<roleID1\> role:\<roleID2\>".
|
|
143
|
+
|
|
144
|
+
request_options : typing.Optional[RequestOptions]
|
|
145
|
+
Request-specific configuration.
|
|
146
|
+
|
|
147
|
+
Returns
|
|
148
|
+
-------
|
|
149
|
+
V1GetAuthTokenResponse
|
|
150
|
+
A successful response.
|
|
151
|
+
|
|
152
|
+
Examples
|
|
153
|
+
--------
|
|
154
|
+
import asyncio
|
|
155
|
+
|
|
156
|
+
from skyflow import AsyncSkyflowAuth
|
|
157
|
+
|
|
158
|
+
client = AsyncSkyflowAuth(
|
|
159
|
+
token="YOUR_TOKEN",
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
async def main() -> None:
|
|
164
|
+
await client.authentication.authentication_service_get_auth_token(
|
|
165
|
+
grant_type="urn:ietf:params:oauth:grant-type:jwt-bearer",
|
|
166
|
+
assertion="eyLhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaXNzIjoiY29tcGFueSIsImV4cCI6MTYxNTE5MzgwNywiaWF0IjoxNjE1MTY1MDQwLCJhdWQiOiKzb21lYXVkaWVuY2UifQ.4pcPyMDQ9o1PSyXnrXCjTwXyr4BSezdI1AVTmud2fU3",
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
asyncio.run(main())
|
|
171
|
+
"""
|
|
172
|
+
_response = await self._raw_client.authentication_service_get_auth_token(
|
|
173
|
+
grant_type=grant_type,
|
|
174
|
+
assertion=assertion,
|
|
175
|
+
subject_token=subject_token,
|
|
176
|
+
subject_token_type=subject_token_type,
|
|
177
|
+
requested_token_use=requested_token_use,
|
|
178
|
+
scope=scope,
|
|
179
|
+
request_options=request_options,
|
|
180
|
+
)
|
|
181
|
+
return _response.data
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..errors.bad_request_error import BadRequestError
|
|
12
|
+
from ..errors.not_found_error import NotFoundError
|
|
13
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
|
14
|
+
from ..types.v_1_get_auth_token_response import V1GetAuthTokenResponse
|
|
15
|
+
|
|
16
|
+
# this is used as the default value for optional parameters
|
|
17
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class RawAuthenticationClient:
|
|
21
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
22
|
+
self._client_wrapper = client_wrapper
|
|
23
|
+
|
|
24
|
+
def authentication_service_get_auth_token(
|
|
25
|
+
self,
|
|
26
|
+
*,
|
|
27
|
+
grant_type: str,
|
|
28
|
+
assertion: str,
|
|
29
|
+
subject_token: typing.Optional[str] = OMIT,
|
|
30
|
+
subject_token_type: typing.Optional[str] = OMIT,
|
|
31
|
+
requested_token_use: typing.Optional[str] = OMIT,
|
|
32
|
+
scope: typing.Optional[str] = OMIT,
|
|
33
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
34
|
+
) -> HttpResponse[V1GetAuthTokenResponse]:
|
|
35
|
+
"""
|
|
36
|
+
<p>Generates a Bearer Token to authenticate with Skyflow. This method doesn't require the <code>Authorization</code> header.</p><p><b>Note:</b> For recommended ways to authenticate, see <a href='/api-authentication/'>API authentication</a>.</p>
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
grant_type : str
|
|
41
|
+
Grant type of the request. Set this to `urn:ietf:params:oauth:grant-type:jwt-bearer`.
|
|
42
|
+
|
|
43
|
+
assertion : str
|
|
44
|
+
User-signed JWT token that contains the following fields: <br/> <ul><li><code>iss</code>: Issuer of the JWT.</li><li><code>key</code>: Unique identifier for the key.</li><li><code>aud</code>: Recipient the JWT is intended for.</li><li><code>exp</code>: Time the JWT expires.</li><li><code>sub</code>: Subject of the JWT.</li><li><code>ctx</code>: (Optional) Value for <a href='/context-aware-overview/'>Context-aware authorization</a>.</li></ul>
|
|
45
|
+
|
|
46
|
+
subject_token : typing.Optional[str]
|
|
47
|
+
Subject token.
|
|
48
|
+
|
|
49
|
+
subject_token_type : typing.Optional[str]
|
|
50
|
+
Subject token type.
|
|
51
|
+
|
|
52
|
+
requested_token_use : typing.Optional[str]
|
|
53
|
+
Token use type. Either `delegation` or `impersonation`.
|
|
54
|
+
|
|
55
|
+
scope : typing.Optional[str]
|
|
56
|
+
Subset of available <a href='#Roles'>roles</a> to associate with the requested token. Uses the format "role:\<roleID1\> role:\<roleID2\>".
|
|
57
|
+
|
|
58
|
+
request_options : typing.Optional[RequestOptions]
|
|
59
|
+
Request-specific configuration.
|
|
60
|
+
|
|
61
|
+
Returns
|
|
62
|
+
-------
|
|
63
|
+
HttpResponse[V1GetAuthTokenResponse]
|
|
64
|
+
A successful response.
|
|
65
|
+
"""
|
|
66
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
67
|
+
"v1/auth/sa/oauth/token",
|
|
68
|
+
method="POST",
|
|
69
|
+
json={
|
|
70
|
+
"grant_type": grant_type,
|
|
71
|
+
"assertion": assertion,
|
|
72
|
+
"subject_token": subject_token,
|
|
73
|
+
"subject_token_type": subject_token_type,
|
|
74
|
+
"requested_token_use": requested_token_use,
|
|
75
|
+
"scope": scope,
|
|
76
|
+
},
|
|
77
|
+
headers={
|
|
78
|
+
"content-type": "application/json",
|
|
79
|
+
},
|
|
80
|
+
request_options=request_options,
|
|
81
|
+
omit=OMIT,
|
|
82
|
+
)
|
|
83
|
+
try:
|
|
84
|
+
if 200 <= _response.status_code < 300:
|
|
85
|
+
_data = typing.cast(
|
|
86
|
+
V1GetAuthTokenResponse,
|
|
87
|
+
parse_obj_as(
|
|
88
|
+
type_=V1GetAuthTokenResponse, # type: ignore
|
|
89
|
+
object_=_response.json(),
|
|
90
|
+
),
|
|
91
|
+
)
|
|
92
|
+
return HttpResponse(response=_response, data=_data)
|
|
93
|
+
if _response.status_code == 400:
|
|
94
|
+
raise BadRequestError(
|
|
95
|
+
headers=dict(_response.headers),
|
|
96
|
+
body=typing.cast(
|
|
97
|
+
typing.Dict[str, typing.Optional[typing.Any]],
|
|
98
|
+
parse_obj_as(
|
|
99
|
+
type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
|
|
100
|
+
object_=_response.json(),
|
|
101
|
+
),
|
|
102
|
+
),
|
|
103
|
+
)
|
|
104
|
+
if _response.status_code == 401:
|
|
105
|
+
raise UnauthorizedError(
|
|
106
|
+
headers=dict(_response.headers),
|
|
107
|
+
body=typing.cast(
|
|
108
|
+
typing.Dict[str, typing.Optional[typing.Any]],
|
|
109
|
+
parse_obj_as(
|
|
110
|
+
type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
|
|
111
|
+
object_=_response.json(),
|
|
112
|
+
),
|
|
113
|
+
),
|
|
114
|
+
)
|
|
115
|
+
if _response.status_code == 404:
|
|
116
|
+
raise NotFoundError(
|
|
117
|
+
headers=dict(_response.headers),
|
|
118
|
+
body=typing.cast(
|
|
119
|
+
typing.Dict[str, typing.Optional[typing.Any]],
|
|
120
|
+
parse_obj_as(
|
|
121
|
+
type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
|
|
122
|
+
object_=_response.json(),
|
|
123
|
+
),
|
|
124
|
+
),
|
|
125
|
+
)
|
|
126
|
+
_response_json = _response.json()
|
|
127
|
+
except JSONDecodeError:
|
|
128
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
129
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class AsyncRawAuthenticationClient:
|
|
133
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
134
|
+
self._client_wrapper = client_wrapper
|
|
135
|
+
|
|
136
|
+
async def authentication_service_get_auth_token(
|
|
137
|
+
self,
|
|
138
|
+
*,
|
|
139
|
+
grant_type: str,
|
|
140
|
+
assertion: str,
|
|
141
|
+
subject_token: typing.Optional[str] = OMIT,
|
|
142
|
+
subject_token_type: typing.Optional[str] = OMIT,
|
|
143
|
+
requested_token_use: typing.Optional[str] = OMIT,
|
|
144
|
+
scope: typing.Optional[str] = OMIT,
|
|
145
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
146
|
+
) -> AsyncHttpResponse[V1GetAuthTokenResponse]:
|
|
147
|
+
"""
|
|
148
|
+
<p>Generates a Bearer Token to authenticate with Skyflow. This method doesn't require the <code>Authorization</code> header.</p><p><b>Note:</b> For recommended ways to authenticate, see <a href='/api-authentication/'>API authentication</a>.</p>
|
|
149
|
+
|
|
150
|
+
Parameters
|
|
151
|
+
----------
|
|
152
|
+
grant_type : str
|
|
153
|
+
Grant type of the request. Set this to `urn:ietf:params:oauth:grant-type:jwt-bearer`.
|
|
154
|
+
|
|
155
|
+
assertion : str
|
|
156
|
+
User-signed JWT token that contains the following fields: <br/> <ul><li><code>iss</code>: Issuer of the JWT.</li><li><code>key</code>: Unique identifier for the key.</li><li><code>aud</code>: Recipient the JWT is intended for.</li><li><code>exp</code>: Time the JWT expires.</li><li><code>sub</code>: Subject of the JWT.</li><li><code>ctx</code>: (Optional) Value for <a href='/context-aware-overview/'>Context-aware authorization</a>.</li></ul>
|
|
157
|
+
|
|
158
|
+
subject_token : typing.Optional[str]
|
|
159
|
+
Subject token.
|
|
160
|
+
|
|
161
|
+
subject_token_type : typing.Optional[str]
|
|
162
|
+
Subject token type.
|
|
163
|
+
|
|
164
|
+
requested_token_use : typing.Optional[str]
|
|
165
|
+
Token use type. Either `delegation` or `impersonation`.
|
|
166
|
+
|
|
167
|
+
scope : typing.Optional[str]
|
|
168
|
+
Subset of available <a href='#Roles'>roles</a> to associate with the requested token. Uses the format "role:\<roleID1\> role:\<roleID2\>".
|
|
169
|
+
|
|
170
|
+
request_options : typing.Optional[RequestOptions]
|
|
171
|
+
Request-specific configuration.
|
|
172
|
+
|
|
173
|
+
Returns
|
|
174
|
+
-------
|
|
175
|
+
AsyncHttpResponse[V1GetAuthTokenResponse]
|
|
176
|
+
A successful response.
|
|
177
|
+
"""
|
|
178
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
179
|
+
"v1/auth/sa/oauth/token",
|
|
180
|
+
method="POST",
|
|
181
|
+
json={
|
|
182
|
+
"grant_type": grant_type,
|
|
183
|
+
"assertion": assertion,
|
|
184
|
+
"subject_token": subject_token,
|
|
185
|
+
"subject_token_type": subject_token_type,
|
|
186
|
+
"requested_token_use": requested_token_use,
|
|
187
|
+
"scope": scope,
|
|
188
|
+
},
|
|
189
|
+
headers={
|
|
190
|
+
"content-type": "application/json",
|
|
191
|
+
},
|
|
192
|
+
request_options=request_options,
|
|
193
|
+
omit=OMIT,
|
|
194
|
+
)
|
|
195
|
+
try:
|
|
196
|
+
if 200 <= _response.status_code < 300:
|
|
197
|
+
_data = typing.cast(
|
|
198
|
+
V1GetAuthTokenResponse,
|
|
199
|
+
parse_obj_as(
|
|
200
|
+
type_=V1GetAuthTokenResponse, # type: ignore
|
|
201
|
+
object_=_response.json(),
|
|
202
|
+
),
|
|
203
|
+
)
|
|
204
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
205
|
+
if _response.status_code == 400:
|
|
206
|
+
raise BadRequestError(
|
|
207
|
+
headers=dict(_response.headers),
|
|
208
|
+
body=typing.cast(
|
|
209
|
+
typing.Dict[str, typing.Optional[typing.Any]],
|
|
210
|
+
parse_obj_as(
|
|
211
|
+
type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
|
|
212
|
+
object_=_response.json(),
|
|
213
|
+
),
|
|
214
|
+
),
|
|
215
|
+
)
|
|
216
|
+
if _response.status_code == 401:
|
|
217
|
+
raise UnauthorizedError(
|
|
218
|
+
headers=dict(_response.headers),
|
|
219
|
+
body=typing.cast(
|
|
220
|
+
typing.Dict[str, typing.Optional[typing.Any]],
|
|
221
|
+
parse_obj_as(
|
|
222
|
+
type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
|
|
223
|
+
object_=_response.json(),
|
|
224
|
+
),
|
|
225
|
+
),
|
|
226
|
+
)
|
|
227
|
+
if _response.status_code == 404:
|
|
228
|
+
raise NotFoundError(
|
|
229
|
+
headers=dict(_response.headers),
|
|
230
|
+
body=typing.cast(
|
|
231
|
+
typing.Dict[str, typing.Optional[typing.Any]],
|
|
232
|
+
parse_obj_as(
|
|
233
|
+
type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
|
|
234
|
+
object_=_response.json(),
|
|
235
|
+
),
|
|
236
|
+
),
|
|
237
|
+
)
|
|
238
|
+
_response_json = _response.json()
|
|
239
|
+
except JSONDecodeError:
|
|
240
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
241
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
from .authentication.client import AsyncAuthenticationClient, AuthenticationClient
|
|
7
|
+
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from .environment import SkyflowAuthEnvironment
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SkyflowAuth:
|
|
12
|
+
"""
|
|
13
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
|
14
|
+
|
|
15
|
+
Parameters
|
|
16
|
+
----------
|
|
17
|
+
base_url : typing.Optional[str]
|
|
18
|
+
The base url to use for requests from the client.
|
|
19
|
+
|
|
20
|
+
environment : SkyflowAuthEnvironment
|
|
21
|
+
The environment to use for requests from the client. from .environment import SkyflowAuthEnvironment
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Defaults to SkyflowAuthEnvironment.PRODUCTION
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
token : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
|
|
30
|
+
headers : typing.Optional[typing.Dict[str, str]]
|
|
31
|
+
Additional headers to send with every request.
|
|
32
|
+
|
|
33
|
+
timeout : typing.Optional[float]
|
|
34
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
35
|
+
|
|
36
|
+
follow_redirects : typing.Optional[bool]
|
|
37
|
+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
|
38
|
+
|
|
39
|
+
httpx_client : typing.Optional[httpx.Client]
|
|
40
|
+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
|
41
|
+
|
|
42
|
+
Examples
|
|
43
|
+
--------
|
|
44
|
+
from skyflow import SkyflowAuth
|
|
45
|
+
|
|
46
|
+
client = SkyflowAuth(
|
|
47
|
+
token="YOUR_TOKEN",
|
|
48
|
+
)
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
def __init__(
|
|
52
|
+
self,
|
|
53
|
+
*,
|
|
54
|
+
base_url: typing.Optional[str] = None,
|
|
55
|
+
environment: SkyflowAuthEnvironment = SkyflowAuthEnvironment.PRODUCTION,
|
|
56
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
57
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
58
|
+
timeout: typing.Optional[float] = None,
|
|
59
|
+
follow_redirects: typing.Optional[bool] = True,
|
|
60
|
+
httpx_client: typing.Optional[httpx.Client] = None,
|
|
61
|
+
):
|
|
62
|
+
_defaulted_timeout = (
|
|
63
|
+
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
|
|
64
|
+
)
|
|
65
|
+
self._client_wrapper = SyncClientWrapper(
|
|
66
|
+
base_url=_get_base_url(base_url=base_url, environment=environment),
|
|
67
|
+
token=token,
|
|
68
|
+
headers=headers,
|
|
69
|
+
httpx_client=httpx_client
|
|
70
|
+
if httpx_client is not None
|
|
71
|
+
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
|
|
72
|
+
if follow_redirects is not None
|
|
73
|
+
else httpx.Client(timeout=_defaulted_timeout),
|
|
74
|
+
timeout=_defaulted_timeout,
|
|
75
|
+
)
|
|
76
|
+
self.authentication = AuthenticationClient(client_wrapper=self._client_wrapper)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class AsyncSkyflowAuth:
|
|
80
|
+
"""
|
|
81
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
|
82
|
+
|
|
83
|
+
Parameters
|
|
84
|
+
----------
|
|
85
|
+
base_url : typing.Optional[str]
|
|
86
|
+
The base url to use for requests from the client.
|
|
87
|
+
|
|
88
|
+
environment : SkyflowAuthEnvironment
|
|
89
|
+
The environment to use for requests from the client. from .environment import SkyflowAuthEnvironment
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
Defaults to SkyflowAuthEnvironment.PRODUCTION
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
token : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
|
|
98
|
+
headers : typing.Optional[typing.Dict[str, str]]
|
|
99
|
+
Additional headers to send with every request.
|
|
100
|
+
|
|
101
|
+
timeout : typing.Optional[float]
|
|
102
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
103
|
+
|
|
104
|
+
follow_redirects : typing.Optional[bool]
|
|
105
|
+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
|
106
|
+
|
|
107
|
+
httpx_client : typing.Optional[httpx.AsyncClient]
|
|
108
|
+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
|
109
|
+
|
|
110
|
+
Examples
|
|
111
|
+
--------
|
|
112
|
+
from skyflow import AsyncSkyflowAuth
|
|
113
|
+
|
|
114
|
+
client = AsyncSkyflowAuth(
|
|
115
|
+
token="YOUR_TOKEN",
|
|
116
|
+
)
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
def __init__(
|
|
120
|
+
self,
|
|
121
|
+
*,
|
|
122
|
+
base_url: typing.Optional[str] = None,
|
|
123
|
+
environment: SkyflowAuthEnvironment = SkyflowAuthEnvironment.PRODUCTION,
|
|
124
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
125
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
126
|
+
timeout: typing.Optional[float] = None,
|
|
127
|
+
follow_redirects: typing.Optional[bool] = True,
|
|
128
|
+
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
|
129
|
+
):
|
|
130
|
+
_defaulted_timeout = (
|
|
131
|
+
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
|
|
132
|
+
)
|
|
133
|
+
self._client_wrapper = AsyncClientWrapper(
|
|
134
|
+
base_url=_get_base_url(base_url=base_url, environment=environment),
|
|
135
|
+
token=token,
|
|
136
|
+
headers=headers,
|
|
137
|
+
httpx_client=httpx_client
|
|
138
|
+
if httpx_client is not None
|
|
139
|
+
else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
|
|
140
|
+
if follow_redirects is not None
|
|
141
|
+
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
|
142
|
+
timeout=_defaulted_timeout,
|
|
143
|
+
)
|
|
144
|
+
self.authentication = AsyncAuthenticationClient(client_wrapper=self._client_wrapper)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SkyflowAuthEnvironment) -> str:
|
|
148
|
+
if base_url is not None:
|
|
149
|
+
return base_url
|
|
150
|
+
elif environment is not None:
|
|
151
|
+
return environment.value
|
|
152
|
+
else:
|
|
153
|
+
raise Exception("Please pass in either base_url or environment to construct the client")
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .api_error import ApiError
|
|
6
|
+
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
|
|
7
|
+
from .datetime_utils import serialize_datetime
|
|
8
|
+
from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
|
|
9
|
+
from .http_client import AsyncHttpClient, HttpClient
|
|
10
|
+
from .http_response import AsyncHttpResponse, HttpResponse
|
|
11
|
+
from .jsonable_encoder import jsonable_encoder
|
|
12
|
+
from .pydantic_utilities import (
|
|
13
|
+
IS_PYDANTIC_V2,
|
|
14
|
+
UniversalBaseModel,
|
|
15
|
+
UniversalRootModel,
|
|
16
|
+
parse_obj_as,
|
|
17
|
+
universal_field_validator,
|
|
18
|
+
universal_root_validator,
|
|
19
|
+
update_forward_refs,
|
|
20
|
+
)
|
|
21
|
+
from .query_encoder import encode_query
|
|
22
|
+
from .remove_none_from_dict import remove_none_from_dict
|
|
23
|
+
from .request_options import RequestOptions
|
|
24
|
+
from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
"ApiError",
|
|
28
|
+
"AsyncClientWrapper",
|
|
29
|
+
"AsyncHttpClient",
|
|
30
|
+
"AsyncHttpResponse",
|
|
31
|
+
"BaseClientWrapper",
|
|
32
|
+
"FieldMetadata",
|
|
33
|
+
"File",
|
|
34
|
+
"HttpClient",
|
|
35
|
+
"HttpResponse",
|
|
36
|
+
"IS_PYDANTIC_V2",
|
|
37
|
+
"RequestOptions",
|
|
38
|
+
"SyncClientWrapper",
|
|
39
|
+
"UniversalBaseModel",
|
|
40
|
+
"UniversalRootModel",
|
|
41
|
+
"convert_and_respect_annotation_metadata",
|
|
42
|
+
"convert_file_dict_to_httpx_tuples",
|
|
43
|
+
"encode_query",
|
|
44
|
+
"jsonable_encoder",
|
|
45
|
+
"parse_obj_as",
|
|
46
|
+
"remove_none_from_dict",
|
|
47
|
+
"serialize_datetime",
|
|
48
|
+
"universal_field_validator",
|
|
49
|
+
"universal_root_validator",
|
|
50
|
+
"update_forward_refs",
|
|
51
|
+
"with_content_type",
|
|
52
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ApiError(Exception):
|
|
7
|
+
headers: Optional[Dict[str, str]]
|
|
8
|
+
status_code: Optional[int]
|
|
9
|
+
body: Any
|
|
10
|
+
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
*,
|
|
14
|
+
headers: Optional[Dict[str, str]] = None,
|
|
15
|
+
status_code: Optional[int] = None,
|
|
16
|
+
body: Any = None,
|
|
17
|
+
) -> None:
|
|
18
|
+
self.headers = headers
|
|
19
|
+
self.status_code = status_code
|
|
20
|
+
self.body = body
|
|
21
|
+
|
|
22
|
+
def __str__(self) -> str:
|
|
23
|
+
return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}"
|