api_client
¶
OQTOPUS Cloud User API
OQTOPUS Cloud User API. This API is used to interact with the OQTOPUS Cloud service. The API provides endpoints to manage devices, jobs, and results.
The version of the OpenAPI document: 1.0 Contact: oqtopus-team[at]googlegroups.com Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
Classes:
-
ApiClient–Generic API client for OpenAPI client library builds.
ApiClient
¶
ApiClient(
configuration=None,
header_name=None,
header_value=None,
cookie=None,
)
Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the OpenAPI templates.
:param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API
Methods:
-
call_api–Makes the HTTP request (synchronous)
-
deserialize–Deserializes response into an object.
-
files_parameters–Builds form parameters.
-
get_default–Return new instance of ApiClient.
-
param_serialize–Builds the HTTP request params needed by the request.
-
parameters_to_tuples–Get parameters as list of tuples, formatting collections.
-
parameters_to_url_query–Get parameters as list of tuples, formatting collections.
-
response_deserialize–Deserializes response into an object.
-
sanitize_for_serialization–Builds a JSON POST object.
-
select_header_accept–Returns
Acceptbased on an array of accepts provided. -
select_header_content_type–Returns
Content-Typebased on an array of content_types provided. -
set_default–Set default instance of ApiClient.
-
update_params_for_auth–Updates header and query params based on authentication setting.
Attributes:
-
user_agent–User agent for this API client
call_api
async
¶
call_api(
method,
url,
header_params=None,
body=None,
post_params=None,
_request_timeout=None,
) -> RESTResponse
Makes the HTTP request (synchronous)
:param method: Method to call.
:param url: Path to method endpoint.
:param header_params: Header parameters to be
placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters,
for application/x-www-form-urlencoded, multipart/form-data.
:param _request_timeout: timeout setting for this request.
:return: RESTResponse
deserialize
¶
deserialize(
response_text: str,
response_type: str,
content_type: Optional[str],
)
Deserializes response into an object.
:param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. :param content_type: content type of response.
:return: deserialized object.
files_parameters
¶
files_parameters(files: Dict[str, Union[str, bytes]])
Builds form parameters.
:param files: File parameters. :return: Form parameters with files.
get_default
classmethod
¶
get_default()
Return new instance of ApiClient.
This method returns newly created, based on default constructor, object of ApiClient class or returns a copy of default ApiClient.
:return: The ApiClient object.
param_serialize
¶
param_serialize(
method,
resource_path,
path_params=None,
query_params=None,
header_params=None,
body=None,
post_params=None,
files=None,
auth_settings=None,
collection_formats=None,
_host=None,
_request_auth=None,
) -> RequestSerialized
Builds the HTTP request params needed by the request.
:param method: Method to call.
:param resource_path: Path to method endpoint.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be
placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters,
for application/x-www-form-urlencoded, multipart/form-data.
:param auth_settings list: Auth Settings names for the request.
:param files dict: key -> filename, value -> filepath,
for multipart/form-data.
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the authentication
in the spec for a single request.
:return: tuple of form (path, http_method, query_params, header_params,
body, post_params, files)
parameters_to_tuples
¶
parameters_to_tuples(params, collection_formats)
Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted
parameters_to_url_query
¶
parameters_to_url_query(params, collection_formats)
Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123)
response_deserialize
¶
response_deserialize(
response_data: RESTResponse,
response_types_map: Optional[Dict[str, T]] = None,
) -> ApiResponse[T]
Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. :param response_types_map: dict of response types. :return: ApiResponse
sanitize_for_serialization
¶
sanitize_for_serialization(obj)
Builds a JSON POST object.
If obj is None, return None. If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict.
:param obj: The data to serialize. :return: The serialized form of data.
select_header_accept
¶
select_header_accept(accepts: List[str]) -> Optional[str]
Returns Accept based on an array of accepts provided.
:param accepts: List of headers. :return: Accept (e.g. application/json).
select_header_content_type
¶
select_header_content_type(content_types)
Returns Content-Type based on an array of content_types provided.
:param content_types: List of content-types. :return: Content-Type (e.g. application/json).
set_default
classmethod
¶
set_default(default)
Set default instance of ApiClient.
It stores default ApiClient.
:param default: object of ApiClient.
update_params_for_auth
¶
update_params_for_auth(
headers,
queries,
auth_settings,
resource_path,
method,
body,
request_auth=None,
) -> None
Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. :resource_path: A string representation of the HTTP request resource path. :method: A string representation of the HTTP request method. :body: A object representing the body of the HTTP request. The object type is the return value of sanitize_for_serialization(). :param request_auth: if set, the provided settings will override the token in the configuration.