Skip to content

Module ogc_api_processes_client.api_client

A sample API conforming to the OGC API - Processes - Part 1 standard

This document is an API definition document provided alongside the OGC API - Processes standard. The OGC API - Processes Standard specifies a processing interface to communicate over a RESTful protocol using JavaScript Object Notation (JSON) encodings. The specification allows for the wrapping of computational tasks into executable processes that can be offered by a server and be invoked by a client application.

The version of the OpenAPI document: 1.0.0 Contact: standards-team@ogc.org Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.

Variables

RequestSerialized

Classes

ApiClient

class 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.

Attributes

Name Type Description Default
configuration None .Configuration object for this client None
header_name None a header to pass when making calls to the API. None
header_value None a header value to pass when making calls to
the API.
None
cookie None a cookie to include in the header when making calls
to the API
None

Class variables

NATIVE_TYPES_MAPPING
PRIMITIVE_TYPES

Static methods

get_default

def 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.

Returns:

Type Description
None The ApiClient object.

set_default

def set_default(
    default
)

Set default instance of ApiClient.

It stores default ApiClient.

Parameters:

Name Type Description Default
default None object of ApiClient. None

Instance variables

user_agent

User agent for this API client

Methods

call_api

def call_api(
    self,
    method,
    url,
    header_params=None,
    body=None,
    post_params=None,
    _request_timeout=None
) -> ogc_api_processes_client.rest.RESTResponse

Makes the HTTP request (synchronous)

Parameters:

Name Type Description Default
method None Method to call. None
url None Path to method endpoint. None
header_params None Header parameters to be
placed in the request header.
None
body None Request body. None
dict post_params Request post form parameters,
for application/x-www-form-urlencoded, multipart/form-data.
None
_request_timeout None timeout setting for this request. None

Returns:

Type Description
None RESTResponse

deserialize

def deserialize(
    self,
    response_text: str,
    response_type: str,
    content_type: str | None
)

Deserializes response into an object.

Parameters:

Name Type Description Default
response None RESTResponse object to be deserialized. None
response_type None class literal for
deserialized object, or string of class name.
None
content_type None content type of response. None

Returns:

Type Description
None deserialized object.

files_parameters

def files_parameters(
    self,
    files: Dict[str, str | bytes | List[str] | List[bytes] | Tuple[str, bytes]]
)

Builds form parameters.

Parameters:

Name Type Description Default
files None File parameters. None

Returns:

Type Description
None Form parameters with files.

param_serialize

def param_serialize(
    self,
    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
) -> Tuple[str, str, Dict[str, str], str | None, List[str]]

Builds the HTTP request params needed by the request.

Parameters:

Name Type Description Default
method None Method to call. None
resource_path None Path to method endpoint. None
path_params None Path parameters in the url. None
query_params None Query parameters in the url. None
header_params None Header parameters to be
placed in the request header.
None
body None Request body. None
dict post_params Request post form parameters,
for application/x-www-form-urlencoded, multipart/form-data.
None
list auth_settings Auth Settings names for the request. None
dict files key -> filename, value -> filepath,
for multipart/form-data.
None
collection_formats None dict of collection formats for path, query,
header, and post parameters.
None
_request_auth None set to override the auth_settings for an a single
request; this effectively ignores the authentication
in the spec for a single request.
None

Returns:

Type Description
None tuple of form (path, http_method, query_params, header_params,
body, post_params, files)

parameters_to_tuples

def parameters_to_tuples(
    self,
    params,
    collection_formats
)

Get parameters as list of tuples, formatting collections.

Parameters:

Name Type Description Default
params None Parameters as dict or list of two-tuples None
collection_formats dict Parameter collection formats None

Returns:

Type Description
None Parameters as list of tuples, collections formatted

parameters_to_url_query

def parameters_to_url_query(
    self,
    params,
    collection_formats
)

Get parameters as list of tuples, formatting collections.

Parameters:

Name Type Description Default
params None Parameters as dict or list of two-tuples None
collection_formats dict Parameter collection formats None

Returns:

Type Description
None URL query string (e.g. a=Hello%20World&b=123)

response_deserialize

def response_deserialize(
    self,
    response_data: ogc_api_processes_client.rest.RESTResponse,
    response_types_map: Dict[str, ~T] | None = None
) -> ogc_api_processes_client.api_response.ApiResponse

Deserializes response into an object.

Parameters:

Name Type Description Default
response_data None RESTResponse object to be deserialized. None
response_types_map None dict of response types. None

Returns:

Type Description
None ApiResponse

sanitize_for_serialization

def sanitize_for_serialization(
    self,
    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.

Parameters:

Name Type Description Default
obj None The data to serialize. None

Returns:

Type Description
None The serialized form of data.

select_header_accept

def select_header_accept(
    self,
    accepts: List[str]
) -> str | None

Returns Accept based on an array of accepts provided.

Parameters:

Name Type Description Default
accepts None List of headers. None

Returns:

Type Description
None Accept (e.g. application/json).

select_header_content_type

def select_header_content_type(
    self,
    content_types
)

Returns Content-Type based on an array of content_types provided.

Parameters:

Name Type Description Default
content_types None List of content-types. None

Returns:

Type Description
None Content-Type (e.g. application/json).

set_default_header

def set_default_header(
    self,
    header_name,
    header_value
)

update_params_for_auth

def update_params_for_auth(
    self,
    headers,
    queries,
    auth_settings,
    resource_path,
    method,
    body,
    request_auth=None
) -> None

Updates header and query params based on authentication setting.

Parameters:

Name Type Description Default
headers None Header parameters dict to be updated. None
queries None Query parameters tuple list to be updated. None
auth_settings None Authentication setting identifiers list. None
request_auth None if set, the provided settings will
override the token in the configuration.
None