pyrestsdk.type.model package — PyRESTSDK documentation

# pyrestsdk.type.model package

## Subpackages

- pyrestsdk.type.model.token package
  - Module contents
    - `AccessToken`
      - `AccessToken.expires_on`
    - `BaseToken`
      - `BaseToken.token`

## Module contents

Houses Models

class pyrestsdk.type.model.BaseEntity(client: A)

  Bases: `object`

  Base Entity Type

  property Client: A

    Gets the client

  abstract property as_dict: Dict

    Gets the object as it’s dict representation

  abstract property as_json: str

    Gest the object’s json representation

  abstract classmethod from_json(entry: Dict) → S

    Converts Json to class type

class pyrestsdk.type.model.HeaderOption(Name: str, Value: Any)

  Bases: `Option`

  Header Option Type

class pyrestsdk.type.model.HeaderOptionCollection

  Bases: `OptionsCollection`[`HeaderOption`]

  Header Option Collection Type

class pyrestsdk.type.model.Option(Name: str, Value: Any)

  Bases: `object`

  Option Type

  Name: str
  Value: Any
  as_dict() → Dict[str, Any]

    Gets the object as it’s dict representation

  to_json() → str

    Gets the ojbect as it’s JSON representation

class pyrestsdk.type.model.OptionsCollection

  Bases: `TypeCollection`[`O`]

  Option Collection Type

  as_dict() → Dict[str, Any]

    Gets the object as it’s dict representation

  as_list() → List[O]

    Gets the object as it’s list representation

class pyrestsdk.type.model.QueryOption(Name: str, Value: Any)

  Bases: `Option`

  Query Option Type

class pyrestsdk.type.model.QueryOptionCollection

  Bases: `OptionsCollection`[`QueryOption`]

  Query Option Collection Type

class pyrestsdk.type.model.TypeCollection

  Bases: `MutableSequence`[`T`]

  Type Collection Type

  append(_TypeCollection__option: T) → None

    Append object to the end of the list.

  clear() → None

    Clears the collection

  count(value: T) → int

    Return number of occurrences of value.

  extend(values: Iterable | OC) → None

    Extend list by appending elements from the iterable.

  index(item, *args) → int

    Return first index of value.

    Raises ValueError if the value is not present.

  insert(index: int, value: T) → None

    Insert object before index.

  remove(value: T) → None

    Remove first occurrence of value.

    Raises ValueError if the value is not present.

  reverse() → None

    Reverses the order of the collection

  sort(*args, **kwds)

    Sort the list in ascending order and return None.

    The sort is in-place (i.e. the list itself is modified) and stable (i.e. the order of two equal elements is maintained).

    If a key function is given, apply it once to each list item and sort them, ascending or descending, according to their function values.

    The reverse flag can be set to sort in descending order.