diff --git a/changelog.md b/changelog.md index 7a553cd..6aebdaf 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,7 @@ # Change Log All notable changes to this project will be documented in this file. -## [0.3.6] - TBA +## [0.3.6] - 2023-03-09 ### Added diff --git a/docs/agent/index.html b/docs/agent/index.html index 1bba542..eef8356 100644 --- a/docs/agent/index.html +++ b/docs/agent/index.html @@ -75,4 +75,4 @@

Index

Generated by pdoc 0.10.0.

- + \ No newline at end of file diff --git a/docs/agent/rtm/api/index.html b/docs/agent/rtm/api/index.html index 7d6ac0a..026fc22 100644 --- a/docs/agent/rtm/api/index.html +++ b/docs/agent/rtm/api/index.html @@ -77,4 +77,4 @@

Index

Generated by pdoc 0.10.0.

- + \ No newline at end of file diff --git a/docs/agent/rtm/api/v33.html b/docs/agent/rtm/api/v33.html index 65fe863..e9e5aa9 100644 --- a/docs/agent/rtm/api/v33.html +++ b/docs/agent/rtm/api/v33.html @@ -798,7 +798,7 @@

Module livechat.agent.rtm.api.v33

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -813,9 +813,9 @@

Module livechat.agent.rtm.api.v33

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values: my, chatting, invited, online. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -1807,7 +1807,7 @@

Classes

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -1822,9 +1822,9 @@

Classes

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values: my, chatting, invited, online. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -3026,7 +3026,7 @@

Returns

-def login(self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_push_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse +def login(self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse

Logs in agent.

@@ -3047,10 +3047,10 @@

Args

away : bool
When True, the connection is set to the away state. Defaults to False.
-
customer_push_level : str
-
Possible values: my, engaged, online. +
customer_monitoring_level : str
+
Possible values: my, chatting, invited, online. Defaults to my if login creates the first session; -otherwise it preserves the current customer_push_level.
+otherwise it preserves the current customer_monitoring_level.
pushes : dict
Use case: when you want to receive only specific pushes.
By default, it's set to all for the version of your currently established RTM connection.
@@ -3075,7 +3075,7 @@

Returns

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -3090,9 +3090,9 @@

Returns

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values: my, chatting, invited, online. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -4252,4 +4252,4 @@

pdoc 0.10.0.

- + \ No newline at end of file diff --git a/docs/agent/rtm/api/v34.html b/docs/agent/rtm/api/v34.html index a44c66c..f383071 100644 --- a/docs/agent/rtm/api/v34.html +++ b/docs/agent/rtm/api/v34.html @@ -764,7 +764,7 @@

Module livechat.agent.rtm.api.v34

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -779,9 +779,9 @@

Module livechat.agent.rtm.api.v34

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -1739,7 +1739,7 @@

Classes

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -1754,9 +1754,9 @@

Classes

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -2923,7 +2923,7 @@

Returns

-def login(self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_push_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse +def login(self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse

Logs in agent.

@@ -2944,10 +2944,10 @@

Args

away : bool
When True, the connection is set to the away state. Defaults to False.
-
customer_push_level : str
-
Possible values: my, engaged, online. +
customer_monitoring_level : str
+
Possible values are: my, chatting, invited, online and highest_available. Defaults to my if login creates the first session; -otherwise it preserves the current customer_push_level.
+otherwise it preserves the current customer_monitoring_level.
pushes : dict
Use case: when you want to receive only specific pushes.
By default, it's set to all for the version of your currently established RTM connection.
@@ -2972,7 +2972,7 @@

Returns

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -2987,9 +2987,9 @@

Returns

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -4108,4 +4108,4 @@

pdoc 0.10.0.

- + \ No newline at end of file diff --git a/docs/agent/rtm/api/v35.html b/docs/agent/rtm/api/v35.html index 6cce31a..10d56c4 100644 --- a/docs/agent/rtm/api/v35.html +++ b/docs/agent/rtm/api/v35.html @@ -764,7 +764,7 @@

Module livechat.agent.rtm.api.v35

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -779,9 +779,9 @@

Module livechat.agent.rtm.api.v35

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -1739,7 +1739,7 @@

Classes

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -1754,9 +1754,9 @@

Classes

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -2923,7 +2923,7 @@

Returns

-def login(self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_push_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse +def login(self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse

Logs in agent.

@@ -2944,10 +2944,10 @@

Args

away : bool
When True, the connection is set to the away state. Defaults to False.
-
customer_push_level : str
-
Possible values: my, engaged, online. +
customer_monitoring_level : str
+
Possible values are: my, chatting, invited, online and highest_available. Defaults to my if login creates the first session; -otherwise it preserves the current customer_push_level.
+otherwise it preserves the current customer_monitoring_level.
pushes : dict
Use case: when you want to receive only specific pushes.
By default, it's set to all for the version of your currently established RTM connection.
@@ -2972,7 +2972,7 @@

Returns

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -2987,9 +2987,9 @@

Returns

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -4108,4 +4108,4 @@

pdoc 0.10.0.

- + \ No newline at end of file diff --git a/docs/agent/rtm/api/v36.html b/docs/agent/rtm/api/v36.html index 19357ed..61b87d5 100644 --- a/docs/agent/rtm/api/v36.html +++ b/docs/agent/rtm/api/v36.html @@ -615,34 +615,6 @@

Module livechat.agent.rtm.api.v36

payload = prepare_payload(locals()) return self.ws.send({'action': 'get_customer', 'payload': payload}) - def list_customers(self, - page_id: str = None, - limit: int = None, - sort_order: str = None, - sort_by: str = None, - filters: dict = None, - payload: dict = None) -> RtmResponse: - ''' Returns the list of Customers. - - Args: - page_id (str): Page ID. - limit (int): Customers limit. Default: 10, maximum: 100. - sort_order (str): Possible values: asc, desc (default). Customers are sorted - by the creation date. - sort_by (str): Possible values: created_at (default), threads_count, visits_count, - agent_last_event or customer_last_event. - filters (dict): Filters object. - payload (dict): Custom payload to be used as request's data. - It overrides all other parameters provided for the method. - - Returns: - RtmResponse: RTM response structure (`request_id`, `action`, - `type`, `success` and `payload` properties) - ''' - if payload is None: - payload = prepare_payload(locals()) - return self.ws.send({'action': 'list_customers', 'payload': payload}) - def create_customer(self, name: str = None, email: str = None, @@ -764,7 +736,7 @@

Module livechat.agent.rtm.api.v36

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -779,9 +751,9 @@

Module livechat.agent.rtm.api.v36

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -1590,34 +1562,6 @@

Classes

payload = prepare_payload(locals()) return self.ws.send({'action': 'get_customer', 'payload': payload}) - def list_customers(self, - page_id: str = None, - limit: int = None, - sort_order: str = None, - sort_by: str = None, - filters: dict = None, - payload: dict = None) -> RtmResponse: - ''' Returns the list of Customers. - - Args: - page_id (str): Page ID. - limit (int): Customers limit. Default: 10, maximum: 100. - sort_order (str): Possible values: asc, desc (default). Customers are sorted - by the creation date. - sort_by (str): Possible values: created_at (default), threads_count, visits_count, - agent_last_event or customer_last_event. - filters (dict): Filters object. - payload (dict): Custom payload to be used as request's data. - It overrides all other parameters provided for the method. - - Returns: - RtmResponse: RTM response structure (`request_id`, `action`, - `type`, `success` and `payload` properties) - ''' - if payload is None: - payload = prepare_payload(locals()) - return self.ws.send({'action': 'list_customers', 'payload': payload}) - def create_customer(self, name: str = None, email: str = None, @@ -1739,7 +1683,7 @@

Classes

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -1754,9 +1698,9 @@

Classes

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -2749,68 +2693,6 @@

Returns

return self.ws.send({'action': 'list_chats', 'payload': payload})
-
-def list_customers(self, page_id: str = None, limit: int = None, sort_order: str = None, sort_by: str = None, filters: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse -
-
-

Returns the list of Customers.

-

Args

-
-
page_id : str
-
Page ID.
-
limit : int
-
Customers limit. Default: 10, maximum: 100.
-
sort_order : str
-
Possible values: asc, desc (default). Customers are sorted -by the creation date.
-
sort_by : str
-
Possible values: created_at (default), threads_count, visits_count, -agent_last_event or customer_last_event.
-
filters : dict
-
Filters object.
-
payload : dict
-
Custom payload to be used as request's data. -It overrides all other parameters provided for the method.
-
-

Returns

-
-
RtmResponse
-
RTM response structure (request_id, action, -type, success and payload properties)
-
-
- -Expand source code - -
def list_customers(self,
-                   page_id: str = None,
-                   limit: int = None,
-                   sort_order: str = None,
-                   sort_by: str = None,
-                   filters: dict = None,
-                   payload: dict = None) -> RtmResponse:
-    ''' Returns the list of Customers.
-
-        Args:
-            page_id (str): Page ID.
-            limit (int): Customers limit. Default: 10, maximum: 100.
-            sort_order (str): Possible values: asc, desc (default). Customers are sorted
-                    by the creation date.
-            sort_by (str): Possible values: created_at (default), threads_count, visits_count,
-                    agent_last_event or customer_last_event.
-            filters (dict): Filters object.
-            payload (dict): Custom payload to be used as request's data.
-                    It overrides all other parameters provided for the method.
-
-        Returns:
-            RtmResponse: RTM response structure (`request_id`, `action`,
-                         `type`, `success` and `payload` properties)
-    '''
-    if payload is None:
-        payload = prepare_payload(locals())
-    return self.ws.send({'action': 'list_customers', 'payload': payload})
-
-
def list_routing_statuses(self, filters: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse
@@ -2923,7 +2805,7 @@

Returns

-def login(self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_push_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse +def login(self, token: str = None, timezone: str = None, reconnect: bool = None, push_notifications: dict = None, application: dict = None, away: bool = None, customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse

Logs in agent.

@@ -2944,10 +2826,10 @@

Args

away : bool
When True, the connection is set to the away state. Defaults to False.
-
customer_push_level : str
-
Possible values: my, engaged, online. +
customer_monitoring_level : str
+
Possible values are: my, chatting, invited, online and highest_available. Defaults to my if login creates the first session; -otherwise it preserves the current customer_push_level.
+otherwise it preserves the current customer_monitoring_level.
pushes : dict
Use case: when you want to receive only specific pushes.
By default, it's set to all for the version of your currently established RTM connection.
@@ -2972,7 +2854,7 @@

Returns

push_notifications: dict = None, application: dict = None, away: bool = None, - customer_push_level: str = None, + customer_monitoring_level: str = None, pushes: dict = None, payload: dict = None) -> RtmResponse: ''' Logs in agent. @@ -2987,9 +2869,9 @@

Returns

the application's name and version. away (bool): When True, the connection is set to the away state. Defaults to False. - customer_push_level (str): Possible values: my, engaged, online. + customer_monitoring_level (str): Possible values are: `my`, `chatting`, `invited`, `online` and `highest_available`. Defaults to my if login creates the first session; - otherwise it preserves the current customer_push_level. + otherwise it preserves the current customer_monitoring_level. pushes (dict): Use case: when you want to receive only specific pushes. By default, it's set to all for the version of your currently established RTM connection. payload (dict): Custom payload to be used as request's data. @@ -4072,7 +3954,6 @@

list_agents_for_transfer
  • list_archives
  • list_chats
  • -
  • list_customers
  • list_routing_statuses
  • list_threads
  • login
  • @@ -4108,4 +3989,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/rtm/base.html b/docs/agent/rtm/base.html index 3ab3ed3..710cf29 100644 --- a/docs/agent/rtm/base.html +++ b/docs/agent/rtm/base.html @@ -207,4 +207,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/rtm/index.html b/docs/agent/rtm/index.html index 0042e99..838bca8 100644 --- a/docs/agent/rtm/index.html +++ b/docs/agent/rtm/index.html @@ -67,4 +67,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/web/api/index.html b/docs/agent/web/api/index.html index c6a3877..fe5f169 100644 --- a/docs/agent/web/api/index.html +++ b/docs/agent/web/api/index.html @@ -77,4 +77,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/web/api/v33.html b/docs/agent/web/api/v33.html index 0283538..0f9bc69 100644 --- a/docs/agent/web/api/v33.html +++ b/docs/agent/web/api/v33.html @@ -4624,4 +4624,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/web/api/v34.html b/docs/agent/web/api/v34.html index d12c109..1a81244 100644 --- a/docs/agent/web/api/v34.html +++ b/docs/agent/web/api/v34.html @@ -4456,4 +4456,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/web/api/v35.html b/docs/agent/web/api/v35.html index 482cc36..1bb5f49 100644 --- a/docs/agent/web/api/v35.html +++ b/docs/agent/web/api/v35.html @@ -4456,4 +4456,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/web/api/v36.html b/docs/agent/web/api/v36.html index 246ac69..3d44072 100644 --- a/docs/agent/web/api/v36.html +++ b/docs/agent/web/api/v36.html @@ -757,41 +757,6 @@

    Module livechat.agent.web.api.v36

    json=payload, headers=headers) - def list_customers(self, - page_id: str = None, - limit: str = None, - sort_order: str = None, - sort_by: str = None, - filters: dict = None, - payload: dict = None, - headers: dict = None) -> httpx.Response: - ''' Returns the list of Customers. - - Args: - page_id (str): ID of the page with paginated results. - limit (str): Limit of results per page. Default: 10, maximum: 100. - sort_order (str): Possible values: asc, desc (default). - sort_by (str): When sorting by fields other than created_at, the entries - with identical values will be additionally sorted by their - creation time. Possible values: created_at (default), - threads_count, visits_count, agent_last_event, customer_last_event. - filters (dict): Possible request filters. - payload (dict): Custom payload to be used as request's data. - It overrides all other parameters provided for the method. - headers (dict): Custom headers to be used with session headers. - They will be merged with session-level values that are set, - however, these method-level parameters will not be persisted across requests. - - Returns: - httpx.Response: The Response object from `httpx` library, - which contains a server’s response to an HTTP request. - ''' - if payload is None: - payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/list_customers', - json=payload, - headers=headers) - def create_customer(self, name: str = None, email: str = None, @@ -1832,41 +1797,6 @@

    Classes

    json=payload, headers=headers) - def list_customers(self, - page_id: str = None, - limit: str = None, - sort_order: str = None, - sort_by: str = None, - filters: dict = None, - payload: dict = None, - headers: dict = None) -> httpx.Response: - ''' Returns the list of Customers. - - Args: - page_id (str): ID of the page with paginated results. - limit (str): Limit of results per page. Default: 10, maximum: 100. - sort_order (str): Possible values: asc, desc (default). - sort_by (str): When sorting by fields other than created_at, the entries - with identical values will be additionally sorted by their - creation time. Possible values: created_at (default), - threads_count, visits_count, agent_last_event, customer_last_event. - filters (dict): Possible request filters. - payload (dict): Custom payload to be used as request's data. - It overrides all other parameters provided for the method. - headers (dict): Custom headers to be used with session headers. - They will be merged with session-level values that are set, - however, these method-level parameters will not be persisted across requests. - - Returns: - httpx.Response: The Response object from `httpx` library, - which contains a server’s response to an HTTP request. - ''' - if payload is None: - payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/list_customers', - json=payload, - headers=headers) - def create_customer(self, name: str = None, email: str = None, @@ -3041,80 +2971,6 @@

    Returns

    headers=headers)
    -
    -def list_customers(self, page_id: str = None, limit: str = None, sort_order: str = None, sort_by: str = None, filters: dict = None, payload: dict = None, headers: dict = None) ‑> httpx.Response -
    -
    -

    Returns the list of Customers.

    -

    Args

    -
    -
    page_id : str
    -
    ID of the page with paginated results.
    -
    limit : str
    -
    Limit of results per page. Default: 10, maximum: 100.
    -
    sort_order : str
    -
    Possible values: asc, desc (default).
    -
    sort_by : str
    -
    When sorting by fields other than created_at, the entries -with identical values will be additionally sorted by their -creation time. Possible values: created_at (default), -threads_count, visits_count, agent_last_event, customer_last_event.
    -
    filters : dict
    -
    Possible request filters.
    -
    payload : dict
    -
    Custom payload to be used as request's data. -It overrides all other parameters provided for the method.
    -
    headers : dict
    -
    Custom headers to be used with session headers. -They will be merged with session-level values that are set, -however, these method-level parameters will not be persisted across requests.
    -
    -

    Returns

    -
    -
    httpx.Response
    -
    The Response object from httpx library, -which contains a server’s response to an HTTP request.
    -
    -
    - -Expand source code - -
    def list_customers(self,
    -                   page_id: str = None,
    -                   limit: str = None,
    -                   sort_order: str = None,
    -                   sort_by: str = None,
    -                   filters: dict = None,
    -                   payload: dict = None,
    -                   headers: dict = None) -> httpx.Response:
    -    ''' Returns the list of Customers.
    -
    -        Args:
    -            page_id (str): ID of the page with paginated results.
    -            limit (str): Limit of results per page. Default: 10, maximum: 100.
    -            sort_order (str): Possible values: asc, desc (default).
    -            sort_by (str): When sorting by fields other than created_at, the entries
    -                           with identical values will be additionally sorted by their
    -                           creation time. Possible values: created_at (default),
    -                           threads_count, visits_count, agent_last_event, customer_last_event.
    -            filters (dict): Possible request filters.
    -            payload (dict): Custom payload to be used as request's data.
    -                            It overrides all other parameters provided for the method.
    -            headers (dict): Custom headers to be used with session headers.
    -                            They will be merged with session-level values that are set,
    -                            however, these method-level parameters will not be persisted across requests.
    -
    -        Returns:
    -            httpx.Response: The Response object from `httpx` library,
    -                            which contains a server’s response to an HTTP request.
    -    '''
    -    if payload is None:
    -        payload = prepare_payload(locals())
    -    return self.session.post(f'{self.api_url}/list_customers',
    -                             json=payload,
    -                             headers=headers)
    -
    -
    def list_routing_statuses(self, filters: dict = None, payload: dict = None, headers: dict = None) ‑> httpx.Response
    @@ -4423,7 +4279,6 @@

    list_agents_for_transfer
  • list_archives
  • list_chats
  • -
  • list_customers
  • list_routing_statuses
  • list_threads
  • mark_events_as_seen
  • @@ -4456,4 +4311,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/web/base.html b/docs/agent/web/base.html index bf51c46..d855f88 100644 --- a/docs/agent/web/base.html +++ b/docs/agent/web/base.html @@ -262,4 +262,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/agent/web/index.html b/docs/agent/web/index.html index f3442be..16e7447 100644 --- a/docs/agent/web/index.html +++ b/docs/agent/web/index.html @@ -67,4 +67,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/billing/api/index.html b/docs/billing/api/index.html new file mode 100644 index 0000000..d8a201a --- /dev/null +++ b/docs/billing/api/index.html @@ -0,0 +1,72 @@ + + + + + + +livechat.billing.api API documentation + + + + + + + + + + + +
    +
    +
    +

    Module livechat.billing.api

    +
    +
    +
    + +Expand source code + +
    # pylint: disable=C0114
    +from .v1 import BillingApiV1
    +
    +
    +
    +

    Sub-modules

    +
    +
    livechat.billing.api.v1
    +
    +

    Billing API module with client class in version 1.

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/billing/api/v1.html b/docs/billing/api/v1.html new file mode 100644 index 0000000..628fa67 --- /dev/null +++ b/docs/billing/api/v1.html @@ -0,0 +1,1515 @@ + + + + + + +livechat.billing.api.v1 API documentation + + + + + + + + + + + +
    +
    +
    +

    Module livechat.billing.api.v1

    +
    +
    +

    Billing API module with client class in version 1.

    +
    + +Expand source code + +
    ''' Billing API module with client class in version 1. '''
    +
    +import httpx
    +
    +from livechat.utils.helpers import prepare_payload
    +from livechat.utils.http_client import HttpClient
    +
    +
    +class BillingApiV1(HttpClient):
    +    ''' Billing API client class in version 1. '''
    +    def __init__(self,
    +                 token: str,
    +                 base_url: str,
    +                 http2: bool,
    +                 proxies=None,
    +                 verify: bool = True):
    +        super().__init__(token, base_url, http2, proxies, verify)
    +        self.api_url = f'https://{base_url}/v1'
    +
    +    # direct_charge
    +
    +    def create_direct_charge(self,
    +                             name: str = None,
    +                             price: int = None,
    +                             quantity: int = None,
    +                             return_url: str = None,
    +                             per_account: bool = None,
    +                             test: bool = None,
    +                             payload: dict = None,
    +                             headers: dict = None) -> httpx.Response:
    +        ''' Creates a new direct charge for the user (one time fee).
    +            Args:
    +                name (str): Name of the direct charge.
    +                price (int): Price of the charge defined in cents.
    +                quantity (int): Number of the accounts within the organization.
    +                return_url (str): Redirection url for the client.
    +                per_account (bool): Whether or not the app is sold in ppa account model. Default: False.
    +                test (str): Whether or not the direct charge is for test. Default: False.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +        return self.session.post(f'{self.api_url}/direct_charge',
    +                                 json=payload,
    +                                 headers=headers)
    +
    +    def get_direct_charge(self,
    +                          charge_id: str,
    +                          params: dict = None,
    +                          headers: dict = None) -> httpx.Response:
    +        ''' Returns specific direct charge.
    +            Args:
    +                charge_id (str): ID of the direct charge.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +            del params['charge_id']
    +        return self.session.get(f'{self.api_url}/direct_charge/{charge_id}',
    +                                params=params,
    +                                headers=headers)
    +
    +    def list_direct_charges(self,
    +                            page: int = None,
    +                            status: str = None,
    +                            order_client_id: str = None,
    +                            params: dict = None,
    +                            headers: dict = None) -> httpx.Response:
    +        ''' Lists all direct charges.
    +            Args:
    +                page (int): Navigate to page number. Default: 1.
    +                status (str): Filter charges by status. One of pending, accepted, active, declined, processed, failed or success.
    +                order_client_id (str): Filter by specific `order_client_id`.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +        return self.session.get(f'{self.api_url}/direct_charge',
    +                                params=params,
    +                                headers=headers)
    +
    +    def activate_direct_charge(self,
    +                               charge_id: str,
    +                               payload: dict = None,
    +                               headers: dict = None) -> httpx.Response:
    +        ''' Activates specific direct charge.
    +            Args:
    +                charge_id (str): ID of the direct charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/direct_charge/{charge_id}/activate',
    +            json=payload,
    +            headers=headers)
    +
    +# ledger
    +
    +    def get_ledger(self,
    +                   page: int = None,
    +                   params: dict = None,
    +                   headers: dict = None) -> httpx.Response:
    +        ''' Returns current ledger.
    +            Args:
    +                page (int): Navigate to page number. Default: 1.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +        return self.session.get(f'{self.api_url}/ledger',
    +                                params=params,
    +                                headers=headers)
    +
    +    def get_ledger_balance(self,
    +                           params: dict = None,
    +                           headers: dict = None) -> httpx.Response:
    +        ''' Returns current ledger balance in cents.
    +            Args:
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +        return self.session.get(f'{self.api_url}/ledger/balance',
    +                                params=params,
    +                                headers=headers)
    +
    +
    +# recurent_charge
    +
    +    def create_recurrent_charge(self,
    +                                name: str = None,
    +                                price: int = None,
    +                                return_url: str = None,
    +                                per_account: bool = None,
    +                                trial_days: int = None,
    +                                months: int = None,
    +                                test: bool = True,
    +                                payload: dict = None,
    +                                headers: dict = None) -> httpx.Response:
    +        ''' Creates a new recurrent charge for the user (periodic payment).
    +            Args:
    +                name (str): Name of the recurrent charge.
    +                price (int): Price of the charge defined in cents.
    +                return_url (str): Redirection url for the client.
    +                per_account (bool): Whether or not the app is sold in ppa account model. Default: False.
    +                trial_days (int): Number of granted trial days. Default: 0.
    +                months (int): Charge frequency expressed in months. Default: 1.
    +                test (str): Whether or not the direct charge is for test. Default: False.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +        return self.session.post(f'{self.api_url}/recurrent_charge',
    +                                 json=payload,
    +                                 headers=headers)
    +
    +    def get_recurrent_charge(self,
    +                             charge_id: str,
    +                             params: dict = None,
    +                             headers: dict = None) -> httpx.Response:
    +        ''' Gets specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +            del params['charge_id']
    +        return self.session.get(f'{self.api_url}/recurrent_charge/{charge_id}',
    +                                params=params,
    +                                headers=headers)
    +
    +    def list_recurrent_charges(self,
    +                               page: int = None,
    +                               status: str = None,
    +                               order_client_id: str = None,
    +                               params: dict = None,
    +                               headers: dict = None) -> httpx.Response:
    +        ''' Lists all recurrent charges.
    +            Args:
    +                page (int): Navigate to specific page number. Default: 1.
    +                status (str): Filter charges by status. One of pending, accepted, active, declined, processed, failed or success.
    +                order_client_id (str): Filter by specific `order_client_id`.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +        return self.session.get(f'{self.api_url}/recurrent_charge',
    +                                params=params,
    +                                headers=headers)
    +
    +    def accept_recurrent_charge(self,
    +                                charge_id: str,
    +                                payload: dict = None,
    +                                headers: dict = None) -> httpx.Response:
    +        ''' Accepts specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/recurrent_charge/{charge_id}/accept',
    +            json=payload,
    +            headers=headers)
    +
    +    def decline_recurrent_charge(self,
    +                                 charge_id: str,
    +                                 payload: dict = None,
    +                                 headers: dict = None) -> httpx.Response:
    +        ''' Declines specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/recurrent_charge/{charge_id}/decline',
    +            json=payload,
    +            headers=headers)
    +
    +    def activate_recurrent_charge(self,
    +                                  charge_id: str,
    +                                  payload: dict = None,
    +                                  headers: dict = None) -> httpx.Response:
    +        ''' Activates specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/recurrent_charge/{charge_id}/activate',
    +            json=payload,
    +            headers=headers)
    +
    +    def cancel_recurrent_charge(self,
    +                                charge_id: str,
    +                                payload: dict = None,
    +                                headers: dict = None) -> httpx.Response:
    +        ''' Cancels specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/recurrent_charge/{charge_id}/cancel',
    +            json=payload,
    +            headers=headers)
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class BillingApiV1 +(token: str, base_url: str, http2: bool, proxies=None, verify: bool = True) +
    +
    +

    Billing API client class in version 1.

    +
    + +Expand source code + +
    class BillingApiV1(HttpClient):
    +    ''' Billing API client class in version 1. '''
    +    def __init__(self,
    +                 token: str,
    +                 base_url: str,
    +                 http2: bool,
    +                 proxies=None,
    +                 verify: bool = True):
    +        super().__init__(token, base_url, http2, proxies, verify)
    +        self.api_url = f'https://{base_url}/v1'
    +
    +    # direct_charge
    +
    +    def create_direct_charge(self,
    +                             name: str = None,
    +                             price: int = None,
    +                             quantity: int = None,
    +                             return_url: str = None,
    +                             per_account: bool = None,
    +                             test: bool = None,
    +                             payload: dict = None,
    +                             headers: dict = None) -> httpx.Response:
    +        ''' Creates a new direct charge for the user (one time fee).
    +            Args:
    +                name (str): Name of the direct charge.
    +                price (int): Price of the charge defined in cents.
    +                quantity (int): Number of the accounts within the organization.
    +                return_url (str): Redirection url for the client.
    +                per_account (bool): Whether or not the app is sold in ppa account model. Default: False.
    +                test (str): Whether or not the direct charge is for test. Default: False.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +        return self.session.post(f'{self.api_url}/direct_charge',
    +                                 json=payload,
    +                                 headers=headers)
    +
    +    def get_direct_charge(self,
    +                          charge_id: str,
    +                          params: dict = None,
    +                          headers: dict = None) -> httpx.Response:
    +        ''' Returns specific direct charge.
    +            Args:
    +                charge_id (str): ID of the direct charge.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +            del params['charge_id']
    +        return self.session.get(f'{self.api_url}/direct_charge/{charge_id}',
    +                                params=params,
    +                                headers=headers)
    +
    +    def list_direct_charges(self,
    +                            page: int = None,
    +                            status: str = None,
    +                            order_client_id: str = None,
    +                            params: dict = None,
    +                            headers: dict = None) -> httpx.Response:
    +        ''' Lists all direct charges.
    +            Args:
    +                page (int): Navigate to page number. Default: 1.
    +                status (str): Filter charges by status. One of pending, accepted, active, declined, processed, failed or success.
    +                order_client_id (str): Filter by specific `order_client_id`.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +        return self.session.get(f'{self.api_url}/direct_charge',
    +                                params=params,
    +                                headers=headers)
    +
    +    def activate_direct_charge(self,
    +                               charge_id: str,
    +                               payload: dict = None,
    +                               headers: dict = None) -> httpx.Response:
    +        ''' Activates specific direct charge.
    +            Args:
    +                charge_id (str): ID of the direct charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/direct_charge/{charge_id}/activate',
    +            json=payload,
    +            headers=headers)
    +
    +# ledger
    +
    +    def get_ledger(self,
    +                   page: int = None,
    +                   params: dict = None,
    +                   headers: dict = None) -> httpx.Response:
    +        ''' Returns current ledger.
    +            Args:
    +                page (int): Navigate to page number. Default: 1.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +        return self.session.get(f'{self.api_url}/ledger',
    +                                params=params,
    +                                headers=headers)
    +
    +    def get_ledger_balance(self,
    +                           params: dict = None,
    +                           headers: dict = None) -> httpx.Response:
    +        ''' Returns current ledger balance in cents.
    +            Args:
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +        return self.session.get(f'{self.api_url}/ledger/balance',
    +                                params=params,
    +                                headers=headers)
    +
    +
    +# recurent_charge
    +
    +    def create_recurrent_charge(self,
    +                                name: str = None,
    +                                price: int = None,
    +                                return_url: str = None,
    +                                per_account: bool = None,
    +                                trial_days: int = None,
    +                                months: int = None,
    +                                test: bool = True,
    +                                payload: dict = None,
    +                                headers: dict = None) -> httpx.Response:
    +        ''' Creates a new recurrent charge for the user (periodic payment).
    +            Args:
    +                name (str): Name of the recurrent charge.
    +                price (int): Price of the charge defined in cents.
    +                return_url (str): Redirection url for the client.
    +                per_account (bool): Whether or not the app is sold in ppa account model. Default: False.
    +                trial_days (int): Number of granted trial days. Default: 0.
    +                months (int): Charge frequency expressed in months. Default: 1.
    +                test (str): Whether or not the direct charge is for test. Default: False.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +        return self.session.post(f'{self.api_url}/recurrent_charge',
    +                                 json=payload,
    +                                 headers=headers)
    +
    +    def get_recurrent_charge(self,
    +                             charge_id: str,
    +                             params: dict = None,
    +                             headers: dict = None) -> httpx.Response:
    +        ''' Gets specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +            del params['charge_id']
    +        return self.session.get(f'{self.api_url}/recurrent_charge/{charge_id}',
    +                                params=params,
    +                                headers=headers)
    +
    +    def list_recurrent_charges(self,
    +                               page: int = None,
    +                               status: str = None,
    +                               order_client_id: str = None,
    +                               params: dict = None,
    +                               headers: dict = None) -> httpx.Response:
    +        ''' Lists all recurrent charges.
    +            Args:
    +                page (int): Navigate to specific page number. Default: 1.
    +                status (str): Filter charges by status. One of pending, accepted, active, declined, processed, failed or success.
    +                order_client_id (str): Filter by specific `order_client_id`.
    +                params (dict): Custom params to be used in request's query string.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if params is None:
    +            params = prepare_payload(locals())
    +        return self.session.get(f'{self.api_url}/recurrent_charge',
    +                                params=params,
    +                                headers=headers)
    +
    +    def accept_recurrent_charge(self,
    +                                charge_id: str,
    +                                payload: dict = None,
    +                                headers: dict = None) -> httpx.Response:
    +        ''' Accepts specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/recurrent_charge/{charge_id}/accept',
    +            json=payload,
    +            headers=headers)
    +
    +    def decline_recurrent_charge(self,
    +                                 charge_id: str,
    +                                 payload: dict = None,
    +                                 headers: dict = None) -> httpx.Response:
    +        ''' Declines specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/recurrent_charge/{charge_id}/decline',
    +            json=payload,
    +            headers=headers)
    +
    +    def activate_recurrent_charge(self,
    +                                  charge_id: str,
    +                                  payload: dict = None,
    +                                  headers: dict = None) -> httpx.Response:
    +        ''' Activates specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/recurrent_charge/{charge_id}/activate',
    +            json=payload,
    +            headers=headers)
    +
    +    def cancel_recurrent_charge(self,
    +                                charge_id: str,
    +                                payload: dict = None,
    +                                headers: dict = None) -> httpx.Response:
    +        ''' Cancels specific recurrent charge.
    +            Args:
    +                charge_id (str): ID of the recurrent charge.
    +                payload (dict): Custom payload to be used as request's data.
    +                                It overrides all other parameters provided for the method.
    +                headers (dict): Custom headers to be used with session headers.
    +                                They will be merged with session-level values that are set,
    +                                however, these method-level parameters will not be persisted across requests.
    +            Returns:
    +                httpx.Response: The Response object from `httpx` library,
    +                                which contains a server's response to an HTTP request.
    +        '''
    +        if payload is None:
    +            payload = prepare_payload(locals())
    +            del payload['charge_id']
    +        return self.session.put(
    +            f'{self.api_url}/recurrent_charge/{charge_id}/cancel',
    +            json=payload,
    +            headers=headers)
    +
    +

    Ancestors

    +
      +
    • livechat.utils.http_client.HttpClient
    • +
    +

    Methods

    +
    +
    +def accept_recurrent_charge(self, charge_id: str, payload: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Accepts specific recurrent charge.

    +

    Args

    +
    +
    charge_id : str
    +
    ID of the recurrent charge.
    +
    payload : dict
    +
    Custom payload to be used as request's data. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def accept_recurrent_charge(self,
    +                            charge_id: str,
    +                            payload: dict = None,
    +                            headers: dict = None) -> httpx.Response:
    +    ''' Accepts specific recurrent charge.
    +        Args:
    +            charge_id (str): ID of the recurrent charge.
    +            payload (dict): Custom payload to be used as request's data.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if payload is None:
    +        payload = prepare_payload(locals())
    +        del payload['charge_id']
    +    return self.session.put(
    +        f'{self.api_url}/recurrent_charge/{charge_id}/accept',
    +        json=payload,
    +        headers=headers)
    +
    +
    +
    +def activate_direct_charge(self, charge_id: str, payload: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Activates specific direct charge.

    +

    Args

    +
    +
    charge_id : str
    +
    ID of the direct charge.
    +
    payload : dict
    +
    Custom payload to be used as request's data. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def activate_direct_charge(self,
    +                           charge_id: str,
    +                           payload: dict = None,
    +                           headers: dict = None) -> httpx.Response:
    +    ''' Activates specific direct charge.
    +        Args:
    +            charge_id (str): ID of the direct charge.
    +            payload (dict): Custom payload to be used as request's data.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if payload is None:
    +        payload = prepare_payload(locals())
    +        del payload['charge_id']
    +    return self.session.put(
    +        f'{self.api_url}/direct_charge/{charge_id}/activate',
    +        json=payload,
    +        headers=headers)
    +
    +
    +
    +def activate_recurrent_charge(self, charge_id: str, payload: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Activates specific recurrent charge.

    +

    Args

    +
    +
    charge_id : str
    +
    ID of the recurrent charge.
    +
    payload : dict
    +
    Custom payload to be used as request's data. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def activate_recurrent_charge(self,
    +                              charge_id: str,
    +                              payload: dict = None,
    +                              headers: dict = None) -> httpx.Response:
    +    ''' Activates specific recurrent charge.
    +        Args:
    +            charge_id (str): ID of the recurrent charge.
    +            payload (dict): Custom payload to be used as request's data.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if payload is None:
    +        payload = prepare_payload(locals())
    +        del payload['charge_id']
    +    return self.session.put(
    +        f'{self.api_url}/recurrent_charge/{charge_id}/activate',
    +        json=payload,
    +        headers=headers)
    +
    +
    +
    +def cancel_recurrent_charge(self, charge_id: str, payload: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Cancels specific recurrent charge.

    +

    Args

    +
    +
    charge_id : str
    +
    ID of the recurrent charge.
    +
    payload : dict
    +
    Custom payload to be used as request's data. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def cancel_recurrent_charge(self,
    +                            charge_id: str,
    +                            payload: dict = None,
    +                            headers: dict = None) -> httpx.Response:
    +    ''' Cancels specific recurrent charge.
    +        Args:
    +            charge_id (str): ID of the recurrent charge.
    +            payload (dict): Custom payload to be used as request's data.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if payload is None:
    +        payload = prepare_payload(locals())
    +        del payload['charge_id']
    +    return self.session.put(
    +        f'{self.api_url}/recurrent_charge/{charge_id}/cancel',
    +        json=payload,
    +        headers=headers)
    +
    +
    +
    +def create_direct_charge(self, name: str = None, price: int = None, quantity: int = None, return_url: str = None, per_account: bool = None, test: bool = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Creates a new direct charge for the user (one time fee).

    +

    Args

    +
    +
    name : str
    +
    Name of the direct charge.
    +
    price : int
    +
    Price of the charge defined in cents.
    +
    quantity : int
    +
    Number of the accounts within the organization.
    +
    return_url : str
    +
    Redirection url for the client.
    +
    per_account : bool
    +
    Whether or not the app is sold in ppa account model. Default: False.
    +
    test : str
    +
    Whether or not the direct charge is for test. Default: False.
    +
    payload : dict
    +
    Custom payload to be used as request's data. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def create_direct_charge(self,
    +                         name: str = None,
    +                         price: int = None,
    +                         quantity: int = None,
    +                         return_url: str = None,
    +                         per_account: bool = None,
    +                         test: bool = None,
    +                         payload: dict = None,
    +                         headers: dict = None) -> httpx.Response:
    +    ''' Creates a new direct charge for the user (one time fee).
    +        Args:
    +            name (str): Name of the direct charge.
    +            price (int): Price of the charge defined in cents.
    +            quantity (int): Number of the accounts within the organization.
    +            return_url (str): Redirection url for the client.
    +            per_account (bool): Whether or not the app is sold in ppa account model. Default: False.
    +            test (str): Whether or not the direct charge is for test. Default: False.
    +            payload (dict): Custom payload to be used as request's data.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if payload is None:
    +        payload = prepare_payload(locals())
    +    return self.session.post(f'{self.api_url}/direct_charge',
    +                             json=payload,
    +                             headers=headers)
    +
    +
    +
    +def create_recurrent_charge(self, name: str = None, price: int = None, return_url: str = None, per_account: bool = None, trial_days: int = None, months: int = None, test: bool = True, payload: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Creates a new recurrent charge for the user (periodic payment).

    +

    Args

    +
    +
    name : str
    +
    Name of the recurrent charge.
    +
    price : int
    +
    Price of the charge defined in cents.
    +
    return_url : str
    +
    Redirection url for the client.
    +
    per_account : bool
    +
    Whether or not the app is sold in ppa account model. Default: False.
    +
    trial_days : int
    +
    Number of granted trial days. Default: 0.
    +
    months : int
    +
    Charge frequency expressed in months. Default: 1.
    +
    test : str
    +
    Whether or not the direct charge is for test. Default: False.
    +
    payload : dict
    +
    Custom payload to be used as request's data. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def create_recurrent_charge(self,
    +                            name: str = None,
    +                            price: int = None,
    +                            return_url: str = None,
    +                            per_account: bool = None,
    +                            trial_days: int = None,
    +                            months: int = None,
    +                            test: bool = True,
    +                            payload: dict = None,
    +                            headers: dict = None) -> httpx.Response:
    +    ''' Creates a new recurrent charge for the user (periodic payment).
    +        Args:
    +            name (str): Name of the recurrent charge.
    +            price (int): Price of the charge defined in cents.
    +            return_url (str): Redirection url for the client.
    +            per_account (bool): Whether or not the app is sold in ppa account model. Default: False.
    +            trial_days (int): Number of granted trial days. Default: 0.
    +            months (int): Charge frequency expressed in months. Default: 1.
    +            test (str): Whether or not the direct charge is for test. Default: False.
    +            payload (dict): Custom payload to be used as request's data.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if payload is None:
    +        payload = prepare_payload(locals())
    +    return self.session.post(f'{self.api_url}/recurrent_charge',
    +                             json=payload,
    +                             headers=headers)
    +
    +
    +
    +def decline_recurrent_charge(self, charge_id: str, payload: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Declines specific recurrent charge.

    +

    Args

    +
    +
    charge_id : str
    +
    ID of the recurrent charge.
    +
    payload : dict
    +
    Custom payload to be used as request's data. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def decline_recurrent_charge(self,
    +                             charge_id: str,
    +                             payload: dict = None,
    +                             headers: dict = None) -> httpx.Response:
    +    ''' Declines specific recurrent charge.
    +        Args:
    +            charge_id (str): ID of the recurrent charge.
    +            payload (dict): Custom payload to be used as request's data.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if payload is None:
    +        payload = prepare_payload(locals())
    +        del payload['charge_id']
    +    return self.session.put(
    +        f'{self.api_url}/recurrent_charge/{charge_id}/decline',
    +        json=payload,
    +        headers=headers)
    +
    +
    +
    +def get_direct_charge(self, charge_id: str, params: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Returns specific direct charge.

    +

    Args

    +
    +
    charge_id : str
    +
    ID of the direct charge.
    +
    params : dict
    +
    Custom params to be used in request's query string. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def get_direct_charge(self,
    +                      charge_id: str,
    +                      params: dict = None,
    +                      headers: dict = None) -> httpx.Response:
    +    ''' Returns specific direct charge.
    +        Args:
    +            charge_id (str): ID of the direct charge.
    +            params (dict): Custom params to be used in request's query string.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if params is None:
    +        params = prepare_payload(locals())
    +        del params['charge_id']
    +    return self.session.get(f'{self.api_url}/direct_charge/{charge_id}',
    +                            params=params,
    +                            headers=headers)
    +
    +
    +
    +def get_ledger(self, page: int = None, params: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Returns current ledger.

    +

    Args

    +
    +
    page : int
    +
    Navigate to page number. Default: 1.
    +
    params : dict
    +
    Custom params to be used in request's query string. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def get_ledger(self,
    +               page: int = None,
    +               params: dict = None,
    +               headers: dict = None) -> httpx.Response:
    +    ''' Returns current ledger.
    +        Args:
    +            page (int): Navigate to page number. Default: 1.
    +            params (dict): Custom params to be used in request's query string.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if params is None:
    +        params = prepare_payload(locals())
    +    return self.session.get(f'{self.api_url}/ledger',
    +                            params=params,
    +                            headers=headers)
    +
    +
    +
    +def get_ledger_balance(self, params: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Returns current ledger balance in cents.

    +

    Args

    +
    +
    params : dict
    +
    Custom params to be used in request's query string. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def get_ledger_balance(self,
    +                       params: dict = None,
    +                       headers: dict = None) -> httpx.Response:
    +    ''' Returns current ledger balance in cents.
    +        Args:
    +            params (dict): Custom params to be used in request's query string.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if params is None:
    +        params = prepare_payload(locals())
    +    return self.session.get(f'{self.api_url}/ledger/balance',
    +                            params=params,
    +                            headers=headers)
    +
    +
    +
    +def get_recurrent_charge(self, charge_id: str, params: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Gets specific recurrent charge.

    +

    Args

    +
    +
    charge_id : str
    +
    ID of the recurrent charge.
    +
    params : dict
    +
    Custom params to be used in request's query string. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def get_recurrent_charge(self,
    +                         charge_id: str,
    +                         params: dict = None,
    +                         headers: dict = None) -> httpx.Response:
    +    ''' Gets specific recurrent charge.
    +        Args:
    +            charge_id (str): ID of the recurrent charge.
    +            params (dict): Custom params to be used in request's query string.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if params is None:
    +        params = prepare_payload(locals())
    +        del params['charge_id']
    +    return self.session.get(f'{self.api_url}/recurrent_charge/{charge_id}',
    +                            params=params,
    +                            headers=headers)
    +
    +
    +
    +def list_direct_charges(self, page: int = None, status: str = None, order_client_id: str = None, params: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Lists all direct charges.

    +

    Args

    +
    +
    page : int
    +
    Navigate to page number. Default: 1.
    +
    status : str
    +
    Filter charges by status. One of pending, accepted, active, declined, processed, failed or success.
    +
    order_client_id : str
    +
    Filter by specific order_client_id.
    +
    params : dict
    +
    Custom params to be used in request's query string. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def list_direct_charges(self,
    +                        page: int = None,
    +                        status: str = None,
    +                        order_client_id: str = None,
    +                        params: dict = None,
    +                        headers: dict = None) -> httpx.Response:
    +    ''' Lists all direct charges.
    +        Args:
    +            page (int): Navigate to page number. Default: 1.
    +            status (str): Filter charges by status. One of pending, accepted, active, declined, processed, failed or success.
    +            order_client_id (str): Filter by specific `order_client_id`.
    +            params (dict): Custom params to be used in request's query string.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if params is None:
    +        params = prepare_payload(locals())
    +    return self.session.get(f'{self.api_url}/direct_charge',
    +                            params=params,
    +                            headers=headers)
    +
    +
    +
    +def list_recurrent_charges(self, page: int = None, status: str = None, order_client_id: str = None, params: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Lists all recurrent charges.

    +

    Args

    +
    +
    page : int
    +
    Navigate to specific page number. Default: 1.
    +
    status : str
    +
    Filter charges by status. One of pending, accepted, active, declined, processed, failed or success.
    +
    order_client_id : str
    +
    Filter by specific order_client_id.
    +
    params : dict
    +
    Custom params to be used in request's query string. +It overrides all other parameters provided for the method.
    +
    headers : dict
    +
    Custom headers to be used with session headers. +They will be merged with session-level values that are set, +however, these method-level parameters will not be persisted across requests.
    +
    +

    Returns

    +
    +
    httpx.Response
    +
    The Response object from httpx library, +which contains a server's response to an HTTP request.
    +
    +
    + +Expand source code + +
    def list_recurrent_charges(self,
    +                           page: int = None,
    +                           status: str = None,
    +                           order_client_id: str = None,
    +                           params: dict = None,
    +                           headers: dict = None) -> httpx.Response:
    +    ''' Lists all recurrent charges.
    +        Args:
    +            page (int): Navigate to specific page number. Default: 1.
    +            status (str): Filter charges by status. One of pending, accepted, active, declined, processed, failed or success.
    +            order_client_id (str): Filter by specific `order_client_id`.
    +            params (dict): Custom params to be used in request's query string.
    +                            It overrides all other parameters provided for the method.
    +            headers (dict): Custom headers to be used with session headers.
    +                            They will be merged with session-level values that are set,
    +                            however, these method-level parameters will not be persisted across requests.
    +        Returns:
    +            httpx.Response: The Response object from `httpx` library,
    +                            which contains a server's response to an HTTP request.
    +    '''
    +    if params is None:
    +        params = prepare_payload(locals())
    +    return self.session.get(f'{self.api_url}/recurrent_charge',
    +                            params=params,
    +                            headers=headers)
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/billing/base.html b/docs/billing/base.html new file mode 100644 index 0000000..ef154fe --- /dev/null +++ b/docs/billing/base.html @@ -0,0 +1,253 @@ + + + + + + +livechat.billing.base API documentation + + + + + + + + + + + +
    +
    +
    +

    Module livechat.billing.base

    +
    +
    +

    Module with base class that allows retrieval of client for specific +Billing API version.

    +
    + +Expand source code + +
    ''' Module with base class that allows retrieval of client for specific
    +    Billing API version. '''
    +
    +# pylint: disable=W0613,W0622,C0103,R0913,R0903
    +
    +from __future__ import annotations
    +
    +from livechat.config import CONFIG
    +
    +from .api import BillingApiV1
    +
    +billing_url = CONFIG.get('billing_url')
    +billing_version = CONFIG.get('billing_version')
    +
    +
    +class BillingApi:
    +    ''' Base class that allows retrieval of client for specific
    +        Billing API version. '''
    +    @staticmethod
    +    def get_client(token: str,
    +                   version: str = billing_version,
    +                   base_url: str = billing_url,
    +                   http2: bool = False,
    +                   proxies: dict = None,
    +                   verify: bool = True) -> BillingApiV1:
    +        ''' Returns client for specific Billing API version.
    +
    +            Args:
    +                token (str): Full token with type Bearer that will be
    +                    used as `Authorization` header in requests to API.
    +                version (str): Billing API's version. Defaults to the v1 version of Billing.
    +                base_url (str): API's base url. Defaults to API's production URL.
    +                http2 (bool): A boolean indicating if HTTP/2 support should be
    +                              enabled. Defaults to `False`.
    +                proxies (dict): A dictionary mapping proxy keys to proxy URLs.
    +                verify (bool): SSL certificates (a.k.a CA bundle) used to
    +                               verify the identity of requested hosts. Either `True` (default CA bundle),
    +                               a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
    +                               (which will disable verification). Defaults to `True`.
    +
    +            Returns:
    +                BillingApi: API client object for specified version.
    +
    +            Raises:
    +                ValueError: If the specified version does not exist.
    +        '''
    +        client = {
    +            '1': BillingApiV1(token, base_url, http2, proxies, verify),
    +        }.get(version)
    +        if not client:
    +            raise ValueError('Provided version does not exist.')
    +        return client
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class BillingApi +
    +
    +

    Base class that allows retrieval of client for specific +Billing API version.

    +
    + +Expand source code + +
    class BillingApi:
    +    ''' Base class that allows retrieval of client for specific
    +        Billing API version. '''
    +    @staticmethod
    +    def get_client(token: str,
    +                   version: str = billing_version,
    +                   base_url: str = billing_url,
    +                   http2: bool = False,
    +                   proxies: dict = None,
    +                   verify: bool = True) -> BillingApiV1:
    +        ''' Returns client for specific Billing API version.
    +
    +            Args:
    +                token (str): Full token with type Bearer that will be
    +                    used as `Authorization` header in requests to API.
    +                version (str): Billing API's version. Defaults to the v1 version of Billing.
    +                base_url (str): API's base url. Defaults to API's production URL.
    +                http2 (bool): A boolean indicating if HTTP/2 support should be
    +                              enabled. Defaults to `False`.
    +                proxies (dict): A dictionary mapping proxy keys to proxy URLs.
    +                verify (bool): SSL certificates (a.k.a CA bundle) used to
    +                               verify the identity of requested hosts. Either `True` (default CA bundle),
    +                               a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
    +                               (which will disable verification). Defaults to `True`.
    +
    +            Returns:
    +                BillingApi: API client object for specified version.
    +
    +            Raises:
    +                ValueError: If the specified version does not exist.
    +        '''
    +        client = {
    +            '1': BillingApiV1(token, base_url, http2, proxies, verify),
    +        }.get(version)
    +        if not client:
    +            raise ValueError('Provided version does not exist.')
    +        return client
    +
    +

    Static methods

    +
    +
    +def get_client(token: str, version: str = '1', base_url: str = 'billing.livechatinc.com', http2: bool = False, proxies: dict = None, verify: bool = True) ‑> BillingApiV1 +
    +
    +

    Returns client for specific Billing API version.

    +

    Args

    +
    +
    token : str
    +
    Full token with type Bearer that will be +used as Authorization header in requests to API.
    +
    version : str
    +
    Billing API's version. Defaults to the v1 version of Billing.
    +
    base_url : str
    +
    API's base url. Defaults to API's production URL.
    +
    http2 : bool
    +
    A boolean indicating if HTTP/2 support should be +enabled. Defaults to False.
    +
    proxies : dict
    +
    A dictionary mapping proxy keys to proxy URLs.
    +
    verify : bool
    +
    SSL certificates (a.k.a CA bundle) used to +verify the identity of requested hosts. Either True (default CA bundle), +a path to an SSL certificate file, an ssl.SSLContext, or False +(which will disable verification). Defaults to True.
    +
    +

    Returns

    +
    +
    BillingApi
    +
    API client object for specified version.
    +
    +

    Raises

    +
    +
    ValueError
    +
    If the specified version does not exist.
    +
    +
    + +Expand source code + +
    @staticmethod
    +def get_client(token: str,
    +               version: str = billing_version,
    +               base_url: str = billing_url,
    +               http2: bool = False,
    +               proxies: dict = None,
    +               verify: bool = True) -> BillingApiV1:
    +    ''' Returns client for specific Billing API version.
    +
    +        Args:
    +            token (str): Full token with type Bearer that will be
    +                used as `Authorization` header in requests to API.
    +            version (str): Billing API's version. Defaults to the v1 version of Billing.
    +            base_url (str): API's base url. Defaults to API's production URL.
    +            http2 (bool): A boolean indicating if HTTP/2 support should be
    +                          enabled. Defaults to `False`.
    +            proxies (dict): A dictionary mapping proxy keys to proxy URLs.
    +            verify (bool): SSL certificates (a.k.a CA bundle) used to
    +                           verify the identity of requested hosts. Either `True` (default CA bundle),
    +                           a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
    +                           (which will disable verification). Defaults to `True`.
    +
    +        Returns:
    +            BillingApi: API client object for specified version.
    +
    +        Raises:
    +            ValueError: If the specified version does not exist.
    +    '''
    +    client = {
    +        '1': BillingApiV1(token, base_url, http2, proxies, verify),
    +    }.get(version)
    +    if not client:
    +        raise ValueError('Provided version does not exist.')
    +    return client
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/billing/index.html b/docs/billing/index.html new file mode 100644 index 0000000..49c3c0d --- /dev/null +++ b/docs/billing/index.html @@ -0,0 +1,78 @@ + + + + + + +livechat.billing API documentation + + + + + + + + + + + +
    +
    +
    +

    Module livechat.billing

    +
    +
    +
    + +Expand source code + +
    # pylint: disable=C0114
    +from livechat.billing.base import BillingApi
    +
    +
    +
    +

    Sub-modules

    +
    +
    livechat.billing.api
    +
    +
    +
    +
    livechat.billing.base
    +
    +

    Module with base class that allows retrieval of client for specific +Billing API version.

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/configuration/api/index.html b/docs/configuration/api/index.html index 62e3a3a..b8875bc 100644 --- a/docs/configuration/api/index.html +++ b/docs/configuration/api/index.html @@ -77,4 +77,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/configuration/api/v33.html b/docs/configuration/api/v33.html index d09565e..58e579e 100644 --- a/docs/configuration/api/v33.html +++ b/docs/configuration/api/v33.html @@ -5011,4 +5011,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/configuration/api/v34.html b/docs/configuration/api/v34.html index 6fd18d9..ca0d02d 100644 --- a/docs/configuration/api/v34.html +++ b/docs/configuration/api/v34.html @@ -5014,4 +5014,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/configuration/api/v35.html b/docs/configuration/api/v35.html index 0dfd91e..dcd9627 100644 --- a/docs/configuration/api/v35.html +++ b/docs/configuration/api/v35.html @@ -6204,4 +6204,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/configuration/api/v36.html b/docs/configuration/api/v36.html index 703794b..a973d6a 100644 --- a/docs/configuration/api/v36.html +++ b/docs/configuration/api/v36.html @@ -6204,4 +6204,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/configuration/base.html b/docs/configuration/base.html index ad4da1a..104abce 100644 --- a/docs/configuration/base.html +++ b/docs/configuration/base.html @@ -280,4 +280,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/configuration/index.html b/docs/configuration/index.html index 2dfbb00..524e691 100644 --- a/docs/configuration/index.html +++ b/docs/configuration/index.html @@ -75,4 +75,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/index.html b/docs/customer/index.html index c18d944..f00cecb 100644 --- a/docs/customer/index.html +++ b/docs/customer/index.html @@ -75,4 +75,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/rtm/api/index.html b/docs/customer/rtm/api/index.html index bcf6b9e..6eba2d1 100644 --- a/docs/customer/rtm/api/index.html +++ b/docs/customer/rtm/api/index.html @@ -77,4 +77,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/rtm/api/v33.html b/docs/customer/rtm/api/v33.html index 8ca5a9a..f598e7d 100644 --- a/docs/customer/rtm/api/v33.html +++ b/docs/customer/rtm/api/v33.html @@ -2731,4 +2731,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/rtm/api/v34.html b/docs/customer/rtm/api/v34.html index 178c6f5..7991336 100644 --- a/docs/customer/rtm/api/v34.html +++ b/docs/customer/rtm/api/v34.html @@ -2731,4 +2731,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/rtm/api/v35.html b/docs/customer/rtm/api/v35.html index 3833b0d..9233b58 100644 --- a/docs/customer/rtm/api/v35.html +++ b/docs/customer/rtm/api/v35.html @@ -2731,4 +2731,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/rtm/api/v36.html b/docs/customer/rtm/api/v36.html index 09b74c5..af24a59 100644 --- a/docs/customer/rtm/api/v36.html +++ b/docs/customer/rtm/api/v36.html @@ -2731,4 +2731,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/rtm/base.html b/docs/customer/rtm/base.html index eb8074c..d652243 100644 --- a/docs/customer/rtm/base.html +++ b/docs/customer/rtm/base.html @@ -275,4 +275,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/rtm/index.html b/docs/customer/rtm/index.html index 0261bd1..6e0a576 100644 --- a/docs/customer/rtm/index.html +++ b/docs/customer/rtm/index.html @@ -67,4 +67,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/web/api/index.html b/docs/customer/web/api/index.html index 7543aed..48c9136 100644 --- a/docs/customer/web/api/index.html +++ b/docs/customer/web/api/index.html @@ -77,4 +77,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/web/api/v33.html b/docs/customer/web/api/v33.html index 7124f92..5a5ef3b 100644 --- a/docs/customer/web/api/v33.html +++ b/docs/customer/web/api/v33.html @@ -3970,4 +3970,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/web/api/v34.html b/docs/customer/web/api/v34.html index 1216a70..0d00d55 100644 --- a/docs/customer/web/api/v34.html +++ b/docs/customer/web/api/v34.html @@ -3970,4 +3970,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/web/api/v35.html b/docs/customer/web/api/v35.html index e2a175e..b65821a 100644 --- a/docs/customer/web/api/v35.html +++ b/docs/customer/web/api/v35.html @@ -3970,4 +3970,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/web/api/v36.html b/docs/customer/web/api/v36.html index 055767e..1ef0084 100644 --- a/docs/customer/web/api/v36.html +++ b/docs/customer/web/api/v36.html @@ -3970,4 +3970,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/web/base.html b/docs/customer/web/base.html index 2bcaa0e..1842b8b 100644 --- a/docs/customer/web/base.html +++ b/docs/customer/web/base.html @@ -385,4 +385,4 @@

    pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/customer/web/index.html b/docs/customer/web/index.html index 828fcad..ef438b4 100644 --- a/docs/customer/web/index.html +++ b/docs/customer/web/index.html @@ -67,4 +67,4 @@

    Index

    Generated by pdoc 0.10.0.

    - + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 1cafd78..f4bf444 100644 --- a/docs/index.html +++ b/docs/index.html @@ -40,6 +40,10 @@

    Sub-modules

    +
    livechat.billing
    +
    +
    +
    livechat.configuration
    @@ -70,6 +74,7 @@

    Index

  • Sub-modules

    • livechat.agent
    • +
    • livechat.billing
    • livechat.configuration
    • livechat.customer
    • livechat.reports
    • @@ -82,4 +87,4 @@

      Index

      Generated by pdoc 0.10.0.

      - + \ No newline at end of file diff --git a/docs/reports/api/index.html b/docs/reports/api/index.html index 17d7a9e..322cb0c 100644 --- a/docs/reports/api/index.html +++ b/docs/reports/api/index.html @@ -77,4 +77,4 @@

      Index

      Generated by pdoc 0.10.0.

      - + \ No newline at end of file diff --git a/docs/reports/api/v33.html b/docs/reports/api/v33.html index aaf9914..a25787c 100644 --- a/docs/reports/api/v33.html +++ b/docs/reports/api/v33.html @@ -569,4 +569,4 @@

      pdoc 0.10.0.

      - + \ No newline at end of file diff --git a/docs/reports/api/v34.html b/docs/reports/api/v34.html index c8cce4c..c0ad3e7 100644 --- a/docs/reports/api/v34.html +++ b/docs/reports/api/v34.html @@ -1615,4 +1615,4 @@

      pdoc 0.10.0.

      - + \ No newline at end of file diff --git a/docs/reports/api/v35.html b/docs/reports/api/v35.html index cc1c9bb..4ce33bd 100644 --- a/docs/reports/api/v35.html +++ b/docs/reports/api/v35.html @@ -1738,4 +1738,4 @@

      pdoc 0.10.0.

      - + \ No newline at end of file diff --git a/docs/reports/api/v36.html b/docs/reports/api/v36.html index 72aed08..dc5408b 100644 --- a/docs/reports/api/v36.html +++ b/docs/reports/api/v36.html @@ -1738,4 +1738,4 @@

      pdoc 0.10.0.

      - + \ No newline at end of file diff --git a/docs/reports/base.html b/docs/reports/base.html index 6480147..0af9dfb 100644 --- a/docs/reports/base.html +++ b/docs/reports/base.html @@ -269,4 +269,4 @@

      pdoc 0.10.0.

      - + \ No newline at end of file diff --git a/docs/reports/index.html b/docs/reports/index.html index ce90862..6387dc6 100644 --- a/docs/reports/index.html +++ b/docs/reports/index.html @@ -75,4 +75,4 @@

      Index

      Generated by pdoc 0.10.0.

      - + \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index fad0a96..2ba00dc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = lc-sdk-python -version = 0.3.5 +version = 0.3.6 description = Package which lets to work with LiveChat API. long_description = file: README.md long_description_content_type = text/markdown