|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Quantum Inspire 2 |
| 5 | +
|
| 6 | + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) |
| 7 | +
|
| 8 | + The version of the OpenAPI document: 0.1.0 |
| 9 | + Generated by OpenAPI Generator (https://openapi-generator.tech) |
| 10 | +
|
| 11 | + Do not edit the class manually. |
| 12 | +""" # noqa: E501 |
| 13 | + |
| 14 | + |
| 15 | +import io |
| 16 | +import warnings |
| 17 | + |
| 18 | +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt |
| 19 | +from typing import Dict, List, Optional, Tuple, Union, Any |
| 20 | + |
| 21 | +try: |
| 22 | + from typing import Annotated |
| 23 | +except ImportError: |
| 24 | + from typing_extensions import Annotated |
| 25 | + |
| 26 | +from compute_api_client.models.auth_config import AuthConfig |
| 27 | + |
| 28 | +from compute_api_client.api_client import ApiClient |
| 29 | +from compute_api_client.api_response import ApiResponse |
| 30 | +from compute_api_client.rest import RESTResponseType |
| 31 | + |
| 32 | + |
| 33 | +class AuthConfigApi: |
| 34 | + """NOTE: This class is auto generated by OpenAPI Generator |
| 35 | + Ref: https://openapi-generator.tech |
| 36 | +
|
| 37 | + Do not edit the class manually. |
| 38 | + """ |
| 39 | + |
| 40 | + def __init__(self, api_client=None) -> None: |
| 41 | + if api_client is None: |
| 42 | + api_client = ApiClient.get_default() |
| 43 | + self.api_client = api_client |
| 44 | + |
| 45 | + |
| 46 | + @validate_call |
| 47 | + async def auth_config_auth_config_get( |
| 48 | + self, |
| 49 | + _request_timeout: Union[ |
| 50 | + None, |
| 51 | + Annotated[StrictFloat, Field(gt=0)], |
| 52 | + Tuple[ |
| 53 | + Annotated[StrictFloat, Field(gt=0)], |
| 54 | + Annotated[StrictFloat, Field(gt=0)] |
| 55 | + ] |
| 56 | + ] = None, |
| 57 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 58 | + _content_type: Optional[StrictStr] = None, |
| 59 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 60 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 61 | + ) -> AuthConfig: |
| 62 | + """Get suggested authentication configuration |
| 63 | +
|
| 64 | +
|
| 65 | + :param _request_timeout: timeout setting for this request. If one |
| 66 | + number provided, it will be total request |
| 67 | + timeout. It can also be a pair (tuple) of |
| 68 | + (connection, read) timeouts. |
| 69 | + :type _request_timeout: int, tuple(int, int), optional |
| 70 | + :param _request_auth: set to override the auth_settings for an a single |
| 71 | + request; this effectively ignores the |
| 72 | + authentication in the spec for a single request. |
| 73 | + :type _request_auth: dict, optional |
| 74 | + :param _content_type: force content-type for the request. |
| 75 | + :type _content_type: str, Optional |
| 76 | + :param _headers: set to override the headers for a single |
| 77 | + request; this effectively ignores the headers |
| 78 | + in the spec for a single request. |
| 79 | + :type _headers: dict, optional |
| 80 | + :param _host_index: set to override the host_index for a single |
| 81 | + request; this effectively ignores the host_index |
| 82 | + in the spec for a single request. |
| 83 | + :type _host_index: int, optional |
| 84 | + :return: Returns the result object. |
| 85 | + """ # noqa: E501 |
| 86 | + |
| 87 | + _param = self._auth_config_auth_config_get_serialize( |
| 88 | + _request_auth=_request_auth, |
| 89 | + _content_type=_content_type, |
| 90 | + _headers=_headers, |
| 91 | + _host_index=_host_index |
| 92 | + ) |
| 93 | + |
| 94 | + _response_types_map: Dict[str, Optional[str]] = { |
| 95 | + '200': "AuthConfig" |
| 96 | + |
| 97 | + } |
| 98 | + response_data = await self.api_client.call_api( |
| 99 | + *_param, |
| 100 | + _request_timeout=_request_timeout |
| 101 | + ) |
| 102 | + await response_data.read() |
| 103 | + return self.api_client.response_deserialize( |
| 104 | + response_data=response_data, |
| 105 | + response_types_map=_response_types_map, |
| 106 | + ).data |
| 107 | + |
| 108 | + |
| 109 | + @validate_call |
| 110 | + async def auth_config_auth_config_get_with_http_info( |
| 111 | + self, |
| 112 | + _request_timeout: Union[ |
| 113 | + None, |
| 114 | + Annotated[StrictFloat, Field(gt=0)], |
| 115 | + Tuple[ |
| 116 | + Annotated[StrictFloat, Field(gt=0)], |
| 117 | + Annotated[StrictFloat, Field(gt=0)] |
| 118 | + ] |
| 119 | + ] = None, |
| 120 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 121 | + _content_type: Optional[StrictStr] = None, |
| 122 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 123 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 124 | + ) -> ApiResponse[AuthConfig]: |
| 125 | + """Get suggested authentication configuration |
| 126 | +
|
| 127 | +
|
| 128 | + :param _request_timeout: timeout setting for this request. If one |
| 129 | + number provided, it will be total request |
| 130 | + timeout. It can also be a pair (tuple) of |
| 131 | + (connection, read) timeouts. |
| 132 | + :type _request_timeout: int, tuple(int, int), optional |
| 133 | + :param _request_auth: set to override the auth_settings for an a single |
| 134 | + request; this effectively ignores the |
| 135 | + authentication in the spec for a single request. |
| 136 | + :type _request_auth: dict, optional |
| 137 | + :param _content_type: force content-type for the request. |
| 138 | + :type _content_type: str, Optional |
| 139 | + :param _headers: set to override the headers for a single |
| 140 | + request; this effectively ignores the headers |
| 141 | + in the spec for a single request. |
| 142 | + :type _headers: dict, optional |
| 143 | + :param _host_index: set to override the host_index for a single |
| 144 | + request; this effectively ignores the host_index |
| 145 | + in the spec for a single request. |
| 146 | + :type _host_index: int, optional |
| 147 | + :return: Returns the result object. |
| 148 | + """ # noqa: E501 |
| 149 | + |
| 150 | + _param = self._auth_config_auth_config_get_serialize( |
| 151 | + _request_auth=_request_auth, |
| 152 | + _content_type=_content_type, |
| 153 | + _headers=_headers, |
| 154 | + _host_index=_host_index |
| 155 | + ) |
| 156 | + |
| 157 | + _response_types_map: Dict[str, Optional[str]] = { |
| 158 | + '200': "AuthConfig" |
| 159 | + |
| 160 | + } |
| 161 | + response_data = await self.api_client.call_api( |
| 162 | + *_param, |
| 163 | + _request_timeout=_request_timeout |
| 164 | + ) |
| 165 | + await response_data.read() |
| 166 | + return self.api_client.response_deserialize( |
| 167 | + response_data=response_data, |
| 168 | + response_types_map=_response_types_map, |
| 169 | + ) |
| 170 | + |
| 171 | + |
| 172 | + @validate_call |
| 173 | + async def auth_config_auth_config_get_without_preload_content( |
| 174 | + self, |
| 175 | + _request_timeout: Union[ |
| 176 | + None, |
| 177 | + Annotated[StrictFloat, Field(gt=0)], |
| 178 | + Tuple[ |
| 179 | + Annotated[StrictFloat, Field(gt=0)], |
| 180 | + Annotated[StrictFloat, Field(gt=0)] |
| 181 | + ] |
| 182 | + ] = None, |
| 183 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 184 | + _content_type: Optional[StrictStr] = None, |
| 185 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 186 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 187 | + ) -> RESTResponseType: |
| 188 | + """Get suggested authentication configuration |
| 189 | +
|
| 190 | +
|
| 191 | + :param _request_timeout: timeout setting for this request. If one |
| 192 | + number provided, it will be total request |
| 193 | + timeout. It can also be a pair (tuple) of |
| 194 | + (connection, read) timeouts. |
| 195 | + :type _request_timeout: int, tuple(int, int), optional |
| 196 | + :param _request_auth: set to override the auth_settings for an a single |
| 197 | + request; this effectively ignores the |
| 198 | + authentication in the spec for a single request. |
| 199 | + :type _request_auth: dict, optional |
| 200 | + :param _content_type: force content-type for the request. |
| 201 | + :type _content_type: str, Optional |
| 202 | + :param _headers: set to override the headers for a single |
| 203 | + request; this effectively ignores the headers |
| 204 | + in the spec for a single request. |
| 205 | + :type _headers: dict, optional |
| 206 | + :param _host_index: set to override the host_index for a single |
| 207 | + request; this effectively ignores the host_index |
| 208 | + in the spec for a single request. |
| 209 | + :type _host_index: int, optional |
| 210 | + :return: Returns the result object. |
| 211 | + """ # noqa: E501 |
| 212 | + |
| 213 | + _param = self._auth_config_auth_config_get_serialize( |
| 214 | + _request_auth=_request_auth, |
| 215 | + _content_type=_content_type, |
| 216 | + _headers=_headers, |
| 217 | + _host_index=_host_index |
| 218 | + ) |
| 219 | + |
| 220 | + _response_types_map: Dict[str, Optional[str]] = { |
| 221 | + '200': "AuthConfig" |
| 222 | + |
| 223 | + } |
| 224 | + response_data = await self.api_client.call_api( |
| 225 | + *_param, |
| 226 | + _request_timeout=_request_timeout |
| 227 | + ) |
| 228 | + return response_data.response |
| 229 | + |
| 230 | + |
| 231 | + def _auth_config_auth_config_get_serialize( |
| 232 | + self, |
| 233 | + _request_auth, |
| 234 | + _content_type, |
| 235 | + _headers, |
| 236 | + _host_index, |
| 237 | + ) -> Tuple: |
| 238 | + |
| 239 | + _host = None |
| 240 | + |
| 241 | + _collection_formats: Dict[str, str] = { |
| 242 | + |
| 243 | + } |
| 244 | + |
| 245 | + _path_params: Dict[str, str] = {} |
| 246 | + _query_params: List[Tuple[str, str]] = [] |
| 247 | + _header_params: Dict[str, Optional[str]] = _headers or {} |
| 248 | + _form_params: List[Tuple[str, str]] = [] |
| 249 | + _files: Dict[str, str] = {} |
| 250 | + _body_params: Optional[bytes] = None |
| 251 | + |
| 252 | + # process the path parameters |
| 253 | + # process the query parameters |
| 254 | + # process the header parameters |
| 255 | + # process the form parameters |
| 256 | + # process the body parameter |
| 257 | + |
| 258 | + |
| 259 | + # set the HTTP header `Accept` |
| 260 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 261 | + [ |
| 262 | + 'application/json' |
| 263 | + ] |
| 264 | + ) |
| 265 | + |
| 266 | + |
| 267 | + # authentication setting |
| 268 | + _auth_settings: List[str] = [ |
| 269 | + ] |
| 270 | + |
| 271 | + return self.api_client.param_serialize( |
| 272 | + method='GET', |
| 273 | + resource_path='/auth_config', |
| 274 | + path_params=_path_params, |
| 275 | + query_params=_query_params, |
| 276 | + header_params=_header_params, |
| 277 | + body=_body_params, |
| 278 | + post_params=_form_params, |
| 279 | + files=_files, |
| 280 | + auth_settings=_auth_settings, |
| 281 | + collection_formats=_collection_formats, |
| 282 | + _host=_host, |
| 283 | + _request_auth=_request_auth |
| 284 | + ) |
| 285 | + |
| 286 | + |
0 commit comments