pyrestsdk package — PyRESTSDK documentation

# pyrestsdk package

## Subpackages

- pyrestsdk.clientfactory package
  - Module contents
    - `AbstractHTTPClientFactory`
      - `AbstractHTTPClientFactory.create_with_custom_middleware()`
      - `AbstractHTTPClientFactory.create_with_default_middleware()`
      - `AbstractHTTPClientFactory.session`
    - `HTTPClientFactory`
      - `HTTPClientFactory.create_with_custom_middleware()`
      - `HTTPClientFactory.create_with_default_middleware()`
- pyrestsdk.credential package
  - Module contents
    - `AbstractBasicCredential`
      - `AbstractBasicCredential.get_basic()`
    - `AbstractCredential`
    - `AbstractKerbroseCredential`
      - `AbstractKerbroseCredential.get_principle()`
    - `AbstractTokenCredential`
      - `AbstractTokenCredential.get_token()`
- pyrestsdk.middleware package
  - Subpackages
    - pyrestsdk.middleware.authorizationhandler package
      - Module contents
  - Module contents
    - `BaseAuthorizationHandler`
      - `BaseAuthorizationHandler.credential`
      - `BaseAuthorizationHandler.retry_count`
    - `BaseMiddleware`
      - `BaseMiddleware.next`
      - `BaseMiddleware.send()`
    - `MiddlewarePipeline`
      - `MiddlewarePipeline.add_middleware()`
      - `MiddlewarePipeline.send()`
- pyrestsdk.request package
  - Subpackages
    - pyrestsdk.request.supports_types package
      - Subpackages
      - Module contents
  - Module contents
    - `BaseRequest`
      - `BaseRequest.parse_response()`
    - `Request`
      - `Request.Client`
      - `Request.Send()`
      - `Request.append_segment_to_request_url()`
      - `Request.generic_type`
      - `Request.header_options`
      - `Request.parse_response()`
      - `Request.request_method`
      - `Request.request_url`
      - `Request.send_request()`
- pyrestsdk.requestbuilder package
  - Module contents
    - `BaseRequestBuilder`
      - `BaseRequestBuilder.Client`
      - `BaseRequestBuilder.append_segment_to_request_url()`
      - `BaseRequestBuilder.request_url`
    - `EntityRequestBuilder`
      - `EntityRequestBuilder.Request()`
      - `EntityRequestBuilder.request`
- pyrestsdk.type package
  - Subpackages
    - pyrestsdk.type.enum package
      - Module contents
    - pyrestsdk.type.exception package
      - Module contents
    - pyrestsdk.type.model package
      - Subpackages
      - Module contents
  - Module contents

## Module contents

Py REST SDK

class pyrestsdk.AbstractServiceClient(*args, **kwargs)

  Bases: `ABC`

  Abstract Service Client Type

  abstract delete(url: str, **kwargs) → Response

    Sends a DELETE request. Returns `Response` object. :param url: URL for the new `Request` object. :param **kwargs: Optional arguments that `request` takes. :rtype: requests.Response

  abstract get(url: str, **kwargs) → Response

    Sends a GET request. Returns `Response` object. :param url: URL for the new `Request` object. :param **kwargs: Optional arguments that `request` takes. :rtype: requests.Response

  abstract head(url: str, **kwargs) → Response

    Sends a HEAD request. Returns `Response` object. :param url: URL for the new `Request` object. :param **kwargs: Optional arguments that `request` takes. :rtype: requests.Response

  abstract options(url: str, **kwargs) → Response

    Sends a OPTIONS request. Returns `Response` object. :param url: URL for the new `Request` object. :param **kwargs: Optional arguments that `request` takes. :rtype: requests.Response

  abstract patch(url: str, data=None, **kwargs) → Response

    Sends a PATCH request. Returns `Response` object. :param url: URL for the new `Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like

    > object to send in the body of the `Request`.

    Parameters:

      **kwargs – Optional arguments that `request` takes.

    Return type:

      requests.Response

  abstract post(url: str, data=None, json=None, **kwargs) → Response

    Sends a POST request. Returns `Response` object. :param url: URL for the new `Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like

    > object to send in the body of the `Request`.

    Parameters:

      - json – (optional) json to send in the body of the `Request`.

      - **kwargs – Optional arguments that `request` takes.

    Return type:

      requests.Response

  abstract put(url: str, data=None, **kwargs) → Response

    Sends a PUT request. Returns `Response` object. :param url: URL for the new `Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like

    > object to send in the body of the `Request`.

    Parameters:

      **kwargs – Optional arguments that `request` takes.

    Return type:

      requests.Response

class pyrestsdk.FeatureUsageFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `IntEnum`

  Enumerated list of values used to flag usage of specific middleware

  AUTH_HANDLER_ENABLED = 4
  DEFAULT_HTTP_PROVIDER_ENABLED = 8
  LOGGING_HANDLER_ENABLED = 16
  NONE = 0
  REDIRECT_HANDLER_ENABLED = 1
  RETRY_HANDLER_ENABLED = 2