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. # noqa: E501
OpenAPI spec version: 1.0 Contact: oqtopus-team[at]googlegroups.com Generated by: https://github.com/swagger-api/swagger-codegen.git
Classes:
-
ApiClient–Generic API client for Swagger client library builds.
ApiClient
¶
ApiClient(
configuration=None,
header_name=None,
header_value=None,
cookie=None,
)
Generic API client for Swagger client library builds.
Swagger 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 Swagger templates.
NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually.
: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) and returns deserialized data.
-
deserialize–Deserializes response into an object.
-
parameters_to_tuples–Get parameters as list of tuples, formatting collections.
-
prepare_post_parameters–Builds form parameters.
-
request–Makes the HTTP request using RESTClient.
-
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. -
update_params_for_auth–Updates header and query params based on authentication setting.
Attributes:
-
user_agent–User agent for this API client
call_api
¶
call_api(
resource_path,
method,
path_params=None,
query_params=None,
header_params=None,
body=None,
post_params=None,
files=None,
response_type=None,
auth_settings=None,
async_req=None,
_return_http_data_only=None,
collection_formats=None,
_preload_content=True,
_request_timeout=None,
)
Makes the HTTP request (synchronous) and returns deserialized data.
To make an async request, set the async_req parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
: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 response: Response data type.
:param files dict: key -> filename, value -> filepath,
for multipart/form-data.
:param async_req bool: execute request asynchronously
:param _return_http_data_only: response data without head status code
and headers
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return:
If async_req parameter is True,
the request will be called asynchronously.
The method will return the request thread.
If parameter async_req is False or missing,
then the method will return the response directly.
deserialize
¶
deserialize(response, response_type)
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.
:return: deserialized object.
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
prepare_post_parameters
¶
prepare_post_parameters(post_params=None, files=None)
Builds form parameters.
:param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files.
request
¶
request(
method,
url,
query_params=None,
headers=None,
post_params=None,
body=None,
_preload_content=True,
_request_timeout=None,
)
Makes the HTTP request using RESTClient.
sanitize_for_serialization
¶
sanitize_for_serialization(obj)
Builds a JSON POST object.
If obj is None, return None. 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 list, sanitize each element in the list. If obj is dict, return the dict. If obj is swagger model, return the properties dict.
:param obj: The data to serialize. :return: The serialized form of data.
select_header_accept
¶
select_header_accept(accepts)
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).
update_params_for_auth
¶
update_params_for_auth(headers, querys, auth_settings)
Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list.