diff --git a/docs/agent/web/api/v34.html b/docs/agent/web/api/v34.html index 5c2d7fa..d12c109 100644 --- a/docs/agent/web/api/v34.html +++ b/docs/agent/web/api/v34.html @@ -476,7 +476,7 @@

Module livechat.agent.web.api.v34

httpx.Response: The Response object from `httpx` library, which contains a server’s response to an HTTP request. ''' return self.session.post(f'{self.api_url}/upload_file', - content=file.read(), + file=file, headers=headers) def send_rich_message_postback(self, @@ -1551,7 +1551,7 @@

Classes

httpx.Response: The Response object from `httpx` library, which contains a server’s response to an HTTP request. ''' return self.session.post(f'{self.api_url}/upload_file', - content=file.read(), + file=file, headers=headers) def send_rich_message_postback(self, @@ -4384,7 +4384,7 @@

Returns

httpx.Response: The Response object from `httpx` library, which contains a server’s response to an HTTP request. ''' return self.session.post(f'{self.api_url}/upload_file', - content=file.read(), + file=file, headers=headers) diff --git a/docs/agent/web/api/v35.html b/docs/agent/web/api/v35.html index eb6b94e..482cc36 100644 --- a/docs/agent/web/api/v35.html +++ b/docs/agent/web/api/v35.html @@ -476,7 +476,7 @@

Module livechat.agent.web.api.v35

httpx.Response: The Response object from `httpx` library, which contains a server’s response to an HTTP request. ''' return self.session.post(f'{self.api_url}/upload_file', - content=file.read(), + file=file, headers=headers) def send_rich_message_postback(self, @@ -1551,7 +1551,7 @@

Classes

httpx.Response: The Response object from `httpx` library, which contains a server’s response to an HTTP request. ''' return self.session.post(f'{self.api_url}/upload_file', - content=file.read(), + file=file, headers=headers) def send_rich_message_postback(self, @@ -4384,7 +4384,7 @@

Returns

httpx.Response: The Response object from `httpx` library, which contains a server’s response to an HTTP request. ''' return self.session.post(f'{self.api_url}/upload_file', - content=file.read(), + file=file, headers=headers) diff --git a/docs/agent/web/base.html b/docs/agent/web/base.html index c4aa3f1..7ec961c 100644 --- a/docs/agent/web/base.html +++ b/docs/agent/web/base.html @@ -51,7 +51,9 @@

Module livechat.agent.web.base

access_token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[AgentWebV33, AgentWebV34, AgentWebV35]: ''' Returns client for specific API version. @@ -62,6 +64,11 @@

Module livechat.agent.web.base

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: API client object for specified version. @@ -70,9 +77,9 @@

Module livechat.agent.web.base

ValueError: If the specified version does not exist. ''' client = { - '3.3': AgentWebV33(access_token, base_url, http2), - '3.4': AgentWebV34(access_token, base_url, http2), - '3.5': AgentWebV35(access_token, base_url, http2), + '3.3': AgentWebV33(access_token, base_url, http2, proxies, verify), + '3.4': AgentWebV34(access_token, base_url, http2, proxies, verify), + '3.5': AgentWebV35(access_token, base_url, http2, proxies, verify), }.get(version) if not client: raise ValueError('Provided version does not exist.') @@ -106,7 +113,9 @@

Classes

access_token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[AgentWebV33, AgentWebV34, AgentWebV35]: ''' Returns client for specific API version. @@ -117,6 +126,11 @@

Classes

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: API client object for specified version. @@ -125,9 +139,9 @@

Classes

ValueError: If the specified version does not exist. ''' client = { - '3.3': AgentWebV33(access_token, base_url, http2), - '3.4': AgentWebV34(access_token, base_url, http2), - '3.5': AgentWebV35(access_token, base_url, http2), + '3.3': AgentWebV33(access_token, base_url, http2, proxies, verify), + '3.4': AgentWebV34(access_token, base_url, http2, proxies, verify), + '3.5': AgentWebV35(access_token, base_url, http2, proxies, verify), }.get(version) if not client: raise ValueError('Provided version does not exist.') @@ -136,7 +150,7 @@

Classes

Static methods

-def get_client(access_token: str, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False) ‑> Union[AgentWebV33AgentWebV34AgentWebV35] +def get_client(access_token: str, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False, proxies: dict = None, verify: bool = True) ‑> Union[AgentWebV33AgentWebV34AgentWebV35]

Returns client for specific API version.

@@ -152,6 +166,13 @@

Args

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

API client object for specified version.

@@ -169,7 +190,9 @@

Raises

access_token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[AgentWebV33, AgentWebV34, AgentWebV35]: ''' Returns client for specific API version. @@ -180,6 +203,11 @@

Raises

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: API client object for specified version. @@ -188,9 +216,9 @@

Raises

ValueError: If the specified version does not exist. ''' client = { - '3.3': AgentWebV33(access_token, base_url, http2), - '3.4': AgentWebV34(access_token, base_url, http2), - '3.5': AgentWebV35(access_token, base_url, http2), + '3.3': AgentWebV33(access_token, base_url, http2, proxies, verify), + '3.4': AgentWebV34(access_token, base_url, http2, proxies, verify), + '3.5': AgentWebV35(access_token, base_url, http2, proxies, verify), }.get(version) if not client: raise ValueError('Provided version does not exist.') diff --git a/docs/configuration/api/v33.html b/docs/configuration/api/v33.html index d020260..d09565e 100644 --- a/docs/configuration/api/v33.html +++ b/docs/configuration/api/v33.html @@ -426,8 +426,9 @@

Module livechat.configuration.api.v33

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -439,8 +440,9 @@

Module livechat.configuration.api.v33

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): Required only when authorizing via PATs. @@ -490,8 +492,8 @@

Module livechat.configuration.api.v33

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, @@ -503,6 +505,7 @@

Module livechat.configuration.api.v33

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. groups (list): Groups the Bot belongs to. webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. @@ -1633,8 +1636,9 @@

Classes

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -1646,8 +1650,9 @@

Classes

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): Required only when authorizing via PATs. @@ -1697,8 +1702,8 @@

Classes

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, @@ -1710,6 +1715,7 @@

Classes

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. groups (list): Groups the Bot belongs to. webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. @@ -2656,7 +2662,7 @@

Returns

-def create_bot(self, name: str = None, avatar: str = None, max_chats_count: int = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +def create_bot(self, name: str = None, avatar: str = None, max_chats_count: int = None, default_group_priority: str = None, job_title: str = None, groups: list = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response

Creates a new Bot.

@@ -2668,10 +2674,12 @@

Args

Avatar URL.
max_chats_count : int
Max. number of incoming chats that can be routed to the Bot; default: 6.
+
default_group_priority : str
+
The default routing priority for a group without defined priority.
+
job_title : str
+
Bot's job title.
groups : list
Groups the Bot belongs to.
-
webhooks : dict
-
Webhooks sent to the Bot.
work_scheduler : dict
Work scheduler options to set for the new Bot.
timezone : str
@@ -2701,8 +2709,9 @@

Returns

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -2714,8 +2723,9 @@

Returns

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): Required only when authorizing via PATs. @@ -4669,7 +4679,7 @@

Returns

-def update_bot(self, id: str = None, name: str = None, avatar: str = None, max_chats_count: int = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +def update_bot(self, id: str = None, name: str = None, avatar: str = None, max_chats_count: int = None, default_group_priority: str = None, groups: list = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response

Updates an existing Bot.

@@ -4683,6 +4693,8 @@

Args

Avatar URL.
max_chats_count : int
Max. number of incoming chats that can be routed to the Bot.
+
default_group_priority : str
+
The default routing priority for a group without defined priority.
groups : list
Groups the Bot belongs to.
webhooks : dict
@@ -4714,8 +4726,8 @@

Returns

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, @@ -4727,6 +4739,7 @@

Returns

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. groups (list): Groups the Bot belongs to. webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. diff --git a/docs/configuration/api/v34.html b/docs/configuration/api/v34.html index 48a5997..6fd18d9 100644 --- a/docs/configuration/api/v34.html +++ b/docs/configuration/api/v34.html @@ -426,8 +426,9 @@

Module livechat.configuration.api.v34

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -439,8 +440,9 @@

Module livechat.configuration.api.v34

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): Required only when authorizing via PATs. @@ -490,6 +492,7 @@

Module livechat.configuration.api.v34

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, @@ -503,6 +506,7 @@

Module livechat.configuration.api.v34

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. groups (list): Groups the Bot belongs to. webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. @@ -1633,8 +1637,9 @@

Classes

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -1646,8 +1651,9 @@

Classes

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): Required only when authorizing via PATs. @@ -1697,6 +1703,7 @@

Classes

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, @@ -1710,6 +1717,7 @@

Classes

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. groups (list): Groups the Bot belongs to. webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. @@ -2656,7 +2664,7 @@

Returns

-def create_bot(self, name: str = None, avatar: str = None, max_chats_count: int = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +def create_bot(self, name: str = None, avatar: str = None, max_chats_count: int = None, default_group_priority: str = None, job_title: str = None, groups: list = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response

Creates a new Bot.

@@ -2668,10 +2676,12 @@

Args

Avatar URL.
max_chats_count : int
Max. number of incoming chats that can be routed to the Bot; default: 6.
+
default_group_priority : str
+
The default routing priority for a group without defined priority.
+
job_title : str
+
Bot's job title.
groups : list
Groups the Bot belongs to.
-
webhooks : dict
-
Webhooks sent to the Bot.
work_scheduler : dict
Work scheduler options to set for the new Bot.
timezone : str
@@ -2701,8 +2711,9 @@

Returns

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -2714,8 +2725,9 @@

Returns

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): Required only when authorizing via PATs. @@ -4669,7 +4681,7 @@

Returns

-def update_bot(self, id: str = None, name: str = None, avatar: str = None, max_chats_count: int = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +def update_bot(self, id: str = None, name: str = None, avatar: str = None, max_chats_count: int = None, default_group_priority: str = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response

Updates an existing Bot.

@@ -4683,6 +4695,8 @@

Args

Avatar URL.
max_chats_count : int
Max. number of incoming chats that can be routed to the Bot.
+
default_group_priority : str
+
The default routing priority for a group without defined priority.
groups : list
Groups the Bot belongs to.
webhooks : dict
@@ -4714,6 +4728,7 @@

Returns

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, @@ -4727,6 +4742,7 @@

Returns

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. groups (list): Groups the Bot belongs to. webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. diff --git a/docs/configuration/api/v35.html b/docs/configuration/api/v35.html index d8f9552..2dc2024 100644 --- a/docs/configuration/api/v35.html +++ b/docs/configuration/api/v35.html @@ -428,8 +428,9 @@

Module livechat.configuration.api.v35

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -440,8 +441,9 @@

Module livechat.configuration.api.v35

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): ID of the client bot will be assigned to. @@ -490,7 +492,7 @@

Module livechat.configuration.api.v35

avatar: str = None, max_chats_count: int = None, groups: list = None, - webhooks: dict = None, + default_group_priority: str = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, @@ -503,7 +505,7 @@

Module livechat.configuration.api.v35

avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. payload (dict): Custom payload to be used as request's data. @@ -1274,54 +1276,6 @@

Module livechat.configuration.api.v35

# Other - def get_license_id(self, - organization_id: str = None, - params: dict = None, - headers: dict = None) -> httpx.Response: - ''' Returns license ID by given organization ID. - - Args: - organization_id (str): Organization ID to get license ID for. - 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}/get_license_id', - params=params, - headers=headers) - - def get_organization_id(self, - license_id: int = None, - params: dict = None, - headers: dict = None) -> httpx.Response: - ''' Returns organization ID by given license ID. - - Args: - license_id (int): License ID to get organization ID for. - 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}/get_organization_id', - params=params, - headers=headers) - def list_channels(self, payload: dict = None, headers: dict = None) -> httpx.Response: @@ -1342,10 +1296,10 @@

Module livechat.configuration.api.v35

json=payload, headers=headers) - def check_product_limits(self, - plan: str = None, - payload: dict = None, - headers: dict = None) -> httpx.Response: + def check_product_limits_for_plan(self, + plan: str = None, + payload: dict = None, + headers: dict = None) -> httpx.Response: ''' Checks product limits for plans. Args: plan (str): License plan to check limit for. @@ -1365,6 +1319,26 @@

Module livechat.configuration.api.v35

json=payload, headers=headers) + def get_product_source(self, + payload: dict = None, + headers: dict = None) -> httpx.Response: + ''' Retrieves the source parameters that were passed when activating the LiveChat product. + Args: + 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.get(f'{self.api_url}/get_product_source', + json=payload, + headers=headers) + # Batch requests @@ -1893,8 +1867,9 @@

Classes

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -1905,8 +1880,9 @@

Classes

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): ID of the client bot will be assigned to. @@ -1955,7 +1931,7 @@

Classes

avatar: str = None, max_chats_count: int = None, groups: list = None, - webhooks: dict = None, + default_group_priority: str = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, @@ -1968,7 +1944,7 @@

Classes

avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. payload (dict): Custom payload to be used as request's data. @@ -2739,54 +2715,6 @@

Classes

# Other - def get_license_id(self, - organization_id: str = None, - params: dict = None, - headers: dict = None) -> httpx.Response: - ''' Returns license ID by given organization ID. - - Args: - organization_id (str): Organization ID to get license ID for. - 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}/get_license_id', - params=params, - headers=headers) - - def get_organization_id(self, - license_id: int = None, - params: dict = None, - headers: dict = None) -> httpx.Response: - ''' Returns organization ID by given license ID. - - Args: - license_id (int): License ID to get organization ID for. - 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}/get_organization_id', - params=params, - headers=headers) - def list_channels(self, payload: dict = None, headers: dict = None) -> httpx.Response: @@ -2807,10 +2735,10 @@

Classes

json=payload, headers=headers) - def check_product_limits(self, - plan: str = None, - payload: dict = None, - headers: dict = None) -> httpx.Response: + def check_product_limits_for_plan(self, + plan: str = None, + payload: dict = None, + headers: dict = None) -> httpx.Response: ''' Checks product limits for plans. Args: plan (str): License plan to check limit for. @@ -2830,6 +2758,26 @@

Classes

json=payload, headers=headers) + def get_product_source(self, + payload: dict = None, + headers: dict = None) -> httpx.Response: + ''' Retrieves the source parameters that were passed when activating the LiveChat product. + Args: + 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.get(f'{self.api_url}/get_product_source', + json=payload, + headers=headers) + # Batch requests @@ -3311,8 +3259,8 @@

Returns

headers=headers) -
-def check_product_limits(self, plan: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +
+def check_product_limits_for_plan(self, plan: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response

Checks product limits for plans.

@@ -3338,10 +3286,10 @@

Returns

Expand source code -
def check_product_limits(self,
-                         plan: str = None,
-                         payload: dict = None,
-                         headers: dict = None) -> httpx.Response:
+
def check_product_limits_for_plan(self,
+                                  plan: str = None,
+                                  payload: dict = None,
+                                  headers: dict = None) -> httpx.Response:
     ''' Checks product limits for plans.
         Args:
             plan (str): License plan to check limit for.
@@ -3465,7 +3413,7 @@ 

Returns

-def create_bot(self, name: str = None, avatar: str = None, max_chats_count: int = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +def create_bot(self, name: str = None, avatar: str = None, max_chats_count: int = None, default_group_priority: str = None, job_title: str = None, groups: list = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response

Creates a new bot.

@@ -3477,10 +3425,12 @@

Args

Avatar URL.
max_chats_count : int
Max. number of incoming chats that can be routed to the Bot; default: 6.
+
default_group_priority : str
+
The default routing priority for a group without defined priority.
+
job_title : str
+
Bot's job title.
groups : list
Groups the Bot belongs to.
-
webhooks : dict
-
Webhooks sent to the Bot.
work_scheduler : dict
Work scheduler options to set for the new Bot.
timezone : str
@@ -3509,8 +3459,9 @@

Returns

name: str = None, avatar: str = None, max_chats_count: int = None, + default_group_priority: str = None, + job_title: str = None, groups: list = None, - webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, owner_client_id: str = None, @@ -3521,8 +3472,9 @@

Returns

name (str): Display name. avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot; default: 6. + default_group_priority (str): The default routing priority for a group without defined priority. + job_title (str): Bot's job title. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. owner_client_id (str): ID of the client bot will be assigned to. @@ -4300,58 +4252,6 @@

Returns

headers=headers)
-
-def get_license_id(self, organization_id: str = None, params: dict = None, headers: dict = None) ‑> httpx.Response -
-
-

Returns license ID by given organization ID.

-

Args

-
-
organization_id : str
-
Organization ID to get license ID for.
-
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_license_id(self,
-                   organization_id: str = None,
-                   params: dict = None,
-                   headers: dict = None) -> httpx.Response:
-    ''' Returns license ID by given organization ID.
-
-        Args:
-            organization_id (str): Organization ID to get license ID for.
-            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}/get_license_id',
-                            params=params,
-                            headers=headers)
-
-
def get_license_webhooks_state(self, owner_client_id: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response
@@ -4406,17 +4306,15 @@

Returns

headers=headers)
-
-def get_organization_id(self, license_id: int = None, params: dict = None, headers: dict = None) ‑> httpx.Response +
+def get_product_source(self, payload: dict = None, headers: dict = None) ‑> httpx.Response
-

Returns organization ID by given license ID.

+

Retrieves the source parameters that were passed when activating the LiveChat product.

Args

-
license_id : int
-
License ID to get organization ID for.
-
params : dict
-
Custom params to be used in request's query string. +
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. @@ -4433,28 +4331,24 @@

Returns

Expand source code -
def get_organization_id(self,
-                        license_id: int = None,
-                        params: dict = None,
-                        headers: dict = None) -> httpx.Response:
-    ''' Returns organization ID by given license ID.
-
+
def get_product_source(self,
+                       payload: dict = None,
+                       headers: dict = None) -> httpx.Response:
+    ''' Retrieves the source parameters that were passed when activating the LiveChat product.
         Args:
-            license_id (int): License ID to get organization ID for.
-            params (dict): Custom params to be used in request's query string.
+            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 params is None:
-        params = prepare_payload(locals())
-    return self.session.get(f'{self.api_url}/get_organization_id',
-                            params=params,
+    if payload is None:
+        payload = prepare_payload(locals())
+    return self.session.get(f'{self.api_url}/get_product_source',
+                            json=payload,
                             headers=headers)
@@ -5677,7 +5571,7 @@

Returns

-def update_bot(self, id: str = None, name: str = None, avatar: str = None, max_chats_count: int = None, groups: list = None, webhooks: dict = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +def update_bot(self, id: str = None, name: str = None, avatar: str = None, max_chats_count: int = None, groups: list = None, default_group_priority: str = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, headers: dict = None) ‑> httpx.Response

Updates an existing Bot.

@@ -5693,8 +5587,8 @@

Args

Max. number of incoming chats that can be routed to the Bot.
groups : list
Groups the Bot belongs to.
-
webhooks : dict
-
Webhooks sent to the Bot.
+
default_group_priority : str
+
The default routing priority for a group without defined priority.
work_scheduler : dict
Work scheduler options to set for the new Bot.
timezone : str
@@ -5723,7 +5617,7 @@

Returns

avatar: str = None, max_chats_count: int = None, groups: list = None, - webhooks: dict = None, + default_group_priority: str = None, work_scheduler: dict = None, timezone: str = None, payload: dict = None, @@ -5736,7 +5630,7 @@

Returns

avatar (str): Avatar URL. max_chats_count (int): Max. number of incoming chats that can be routed to the Bot. groups (list): Groups the Bot belongs to. - webhooks (dict): Webhooks sent to the Bot. + default_group_priority (str): The default routing priority for a group without defined priority. work_scheduler (dict): Work scheduler options to set for the new Bot. timezone (str): The time zone in which the Bot's work scheduler should operate. payload (dict): Custom payload to be used as request's data. @@ -6017,7 +5911,7 @@

batch_suspend_agents
  • batch_unsuspend_agents
  • batch_update_agents
  • -
  • check_product_limits
  • +
  • check_product_limits_for_plan
  • create_agent
  • create_bot
  • create_group
  • @@ -6034,9 +5928,8 @@

    get_agent
  • get_bot
  • get_group
  • -
  • get_license_id
  • get_license_webhooks_state
  • -
  • get_organization_id
  • +
  • get_product_source
  • list_agents
  • list_auto_accesses
  • list_bots
  • diff --git a/docs/configuration/base.html b/docs/configuration/base.html index b2c79c8..9f5bb98 100644 --- a/docs/configuration/base.html +++ b/docs/configuration/base.html @@ -54,7 +54,9 @@

    Module livechat.configuration.base

    token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[ConfigurationApiV33, ConfigurationApiV34, ConfigurationApiV35]: ''' Returns client for specific Configuration API version. @@ -65,6 +67,11 @@

    Module livechat.configuration.base

    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: ConfigurationApi: API client object for specified version. @@ -73,9 +80,12 @@

    Module livechat.configuration.base

    ValueError: If the specified version does not exist. ''' client = { - '3.3': ConfigurationApiV33(token, base_url, http2), - '3.4': ConfigurationApiV34(token, base_url, http2), - '3.5': ConfigurationApiV35(token, base_url, http2), + '3.3': ConfigurationApiV33(token, base_url, http2, proxies, + verify), + '3.4': ConfigurationApiV34(token, base_url, http2, proxies, + verify), + '3.5': ConfigurationApiV35(token, base_url, http2, proxies, + verify), }.get(version) if not client: raise ValueError('Provided version does not exist.') @@ -109,7 +119,9 @@

    Classes

    token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[ConfigurationApiV33, ConfigurationApiV34, ConfigurationApiV35]: ''' Returns client for specific Configuration API version. @@ -120,6 +132,11 @@

    Classes

    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: ConfigurationApi: API client object for specified version. @@ -128,9 +145,12 @@

    Classes

    ValueError: If the specified version does not exist. ''' client = { - '3.3': ConfigurationApiV33(token, base_url, http2), - '3.4': ConfigurationApiV34(token, base_url, http2), - '3.5': ConfigurationApiV35(token, base_url, http2), + '3.3': ConfigurationApiV33(token, base_url, http2, proxies, + verify), + '3.4': ConfigurationApiV34(token, base_url, http2, proxies, + verify), + '3.5': ConfigurationApiV35(token, base_url, http2, proxies, + verify), }.get(version) if not client: raise ValueError('Provided version does not exist.') @@ -139,7 +159,7 @@

    Classes

    Static methods

    -def get_client(token: str, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False) ‑> Union[ConfigurationApiV33ConfigurationApiV34ConfigurationApiV35] +def get_client(token: str, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False, proxies: dict = None, verify: bool = True) ‑> Union[ConfigurationApiV33ConfigurationApiV34ConfigurationApiV35]

    Returns client for specific Configuration API version.

    @@ -155,6 +175,13 @@

    Args

    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

    @@ -175,7 +202,9 @@

    Raises

    token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[ConfigurationApiV33, ConfigurationApiV34, ConfigurationApiV35]: ''' Returns client for specific Configuration API version. @@ -186,6 +215,11 @@

    Raises

    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: ConfigurationApi: API client object for specified version. @@ -194,9 +228,12 @@

    Raises

    ValueError: If the specified version does not exist. ''' client = { - '3.3': ConfigurationApiV33(token, base_url, http2), - '3.4': ConfigurationApiV34(token, base_url, http2), - '3.5': ConfigurationApiV35(token, base_url, http2), + '3.3': ConfigurationApiV33(token, base_url, http2, proxies, + verify), + '3.4': ConfigurationApiV34(token, base_url, http2, proxies, + verify), + '3.5': ConfigurationApiV35(token, base_url, http2, proxies, + verify), }.get(version) if not client: raise ValueError('Provided version does not exist.') diff --git a/docs/customer/web/base.html b/docs/customer/web/base.html index 8f34c95..841fa1f 100644 --- a/docs/customer/web/base.html +++ b/docs/customer/web/base.html @@ -54,18 +54,25 @@

    Module livechat.customer.web.base

    version: str = stable_version, base_url: str = api_url, http2: bool = False, + proxies: dict = None, + verify: bool = True, organization_id: str = None ) -> Union[CustomerWebV33, CustomerWebV34, CustomerWebV35]: ''' Returns client for specific API version. Args: license_id (int): License ID. Required to use for API version <= 3.3. - token (str): Full token with type (Bearer/Basic) that will be + access_token (str): Full token with type (Bearer/Basic) that will be used as `Authorization` header in requests to API. version (str): API's version. Defaults to the stable version of API. 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`. organization_id (str): Organization ID, replaced license ID in v3.4. Returns: @@ -85,19 +92,25 @@

    Module livechat.customer.web.base

    'license_id': license_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, '3.4': { 'organization_id': organization_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, '3.5': { 'organization_id': organization_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, }.get(version) if client: @@ -134,18 +147,25 @@

    Classes

    version: str = stable_version, base_url: str = api_url, http2: bool = False, + proxies: dict = None, + verify: bool = True, organization_id: str = None ) -> Union[CustomerWebV33, CustomerWebV34, CustomerWebV35]: ''' Returns client for specific API version. Args: license_id (int): License ID. Required to use for API version <= 3.3. - token (str): Full token with type (Bearer/Basic) that will be + access_token (str): Full token with type (Bearer/Basic) that will be used as `Authorization` header in requests to API. version (str): API's version. Defaults to the stable version of API. 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`. organization_id (str): Organization ID, replaced license ID in v3.4. Returns: @@ -165,19 +185,25 @@

    Classes

    'license_id': license_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, '3.4': { 'organization_id': organization_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, '3.5': { 'organization_id': organization_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, }.get(version) if client: @@ -187,7 +213,7 @@

    Classes

    Static methods

    -def get_client(license_id: int = None, access_token: str = None, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False, organization_id: str = None) ‑> Union[CustomerWebV33CustomerWebV34CustomerWebV35] +def get_client(license_id: int = None, access_token: str = None, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False, proxies: dict = None, verify: bool = True, organization_id: str = None) ‑> Union[CustomerWebV33CustomerWebV34CustomerWebV35]

    Returns client for specific API version.

    @@ -195,7 +221,7 @@

    Args

    license_id : int
    License ID. Required to use for API version <= 3.3.
    -
    token : str
    +
    access_token : str
    Full token with type (Bearer/Basic) that will be used as Authorization header in requests to API.
    version : str
    @@ -205,6 +231,13 @@

    Args

    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.
    organization_id : str
    Organization ID, replaced license ID in v3.4.
    @@ -227,18 +260,25 @@

    Raises

    version: str = stable_version, base_url: str = api_url, http2: bool = False, + proxies: dict = None, + verify: bool = True, organization_id: str = None ) -> Union[CustomerWebV33, CustomerWebV34, CustomerWebV35]: ''' Returns client for specific API version. Args: license_id (int): License ID. Required to use for API version <= 3.3. - token (str): Full token with type (Bearer/Basic) that will be + access_token (str): Full token with type (Bearer/Basic) that will be used as `Authorization` header in requests to API. version (str): API's version. Defaults to the stable version of API. 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`. organization_id (str): Organization ID, replaced license ID in v3.4. Returns: @@ -258,19 +298,25 @@

    Raises

    'license_id': license_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, '3.4': { 'organization_id': organization_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, '3.5': { 'organization_id': organization_id, 'access_token': access_token, 'base_url': base_url, - 'http2': http2 + 'http2': http2, + 'proxies': proxies, + 'verify': verify }, }.get(version) if client: diff --git a/docs/reports/api/v34.html b/docs/reports/api/v34.html index 61a7632..c8cce4c 100644 --- a/docs/reports/api/v34.html +++ b/docs/reports/api/v34.html @@ -312,7 +312,7 @@

    Module livechat.reports.api.v34

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/response_time', + return self.session.post(f'{self.api_url}/chats/response_time', json=payload, headers=headers) @@ -342,7 +342,7 @@

    Module livechat.reports.api.v34

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/first_response_time', + return self.session.post(f'{self.api_url}/chats/first_response_time', json=payload, headers=headers) @@ -705,7 +705,7 @@

    Classes

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/response_time', + return self.session.post(f'{self.api_url}/chats/response_time', json=payload, headers=headers) @@ -735,7 +735,7 @@

    Classes

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/first_response_time', + return self.session.post(f'{self.api_url}/chats/first_response_time', json=payload, headers=headers) @@ -1058,7 +1058,7 @@

    Returns

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/first_response_time', + return self.session.post(f'{self.api_url}/chats/first_response_time', json=payload, headers=headers)
    @@ -1378,7 +1378,7 @@

    Returns

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/response_time', + return self.session.post(f'{self.api_url}/chats/response_time', json=payload, headers=headers)
    diff --git a/docs/reports/api/v35.html b/docs/reports/api/v35.html index 03feb73..cc1c9bb 100644 --- a/docs/reports/api/v35.html +++ b/docs/reports/api/v35.html @@ -312,7 +312,7 @@

    Module livechat.reports.api.v35

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/response_time', + return self.session.post(f'{self.api_url}/chats/response_time', json=payload, headers=headers) @@ -342,7 +342,7 @@

    Module livechat.reports.api.v35

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/first_response_time', + return self.session.post(f'{self.api_url}/chats/first_response_time', json=payload, headers=headers) @@ -411,11 +411,11 @@

    Module livechat.reports.api.v35

    # Tags - def tags_chat_usage(self, - timezone: str = None, - filters: dict = None, - payload: dict = None, - headers: dict = None) -> httpx.Response: + def chat_usage(self, + timezone: str = None, + filters: dict = None, + payload: dict = None, + headers: dict = None) -> httpx.Response: ''' Shows the total number of chats marked with each tag. Args: @@ -736,7 +736,7 @@

    Classes

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/response_time', + return self.session.post(f'{self.api_url}/chats/response_time', json=payload, headers=headers) @@ -766,7 +766,7 @@

    Classes

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/first_response_time', + return self.session.post(f'{self.api_url}/chats/first_response_time', json=payload, headers=headers) @@ -835,11 +835,11 @@

    Classes

    # Tags - def tags_chat_usage(self, - timezone: str = None, - filters: dict = None, - payload: dict = None, - headers: dict = None) -> httpx.Response: + def chat_usage(self, + timezone: str = None, + filters: dict = None, + payload: dict = None, + headers: dict = None) -> httpx.Response: ''' Shows the total number of chats marked with each tag. Args: @@ -933,6 +933,66 @@

    Returns

    headers=headers)
    +
    +def chat_usage(self, timezone: str = None, filters: dict = None, payload: dict = None, headers: dict = None) ‑> httpx.Response +
    +
    +

    Shows the total number of chats marked with each tag.

    +

    Args

    +
    +
    timezone : str
    +
    IANA Time Zone (e.g. America/Phoenix). +Defaults to the requester's timezone. +When the requester's timezone isn't present, then filters.from is parsed to get the timezone.
    +
    filters : dict
    +
    If none provided, your report will span the last seven days.
    +
    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 chat_usage(self,
    +               timezone: str = None,
    +               filters: dict = None,
    +               payload: dict = None,
    +               headers: dict = None) -> httpx.Response:
    +    ''' Shows the total number of chats marked with each tag.
    +
    +    Args:
    +        timezone (str): IANA Time Zone (e.g. America/Phoenix).
    +                        Defaults to the requester's timezone.
    +                        When the requester's timezone isn't present, then `filters.from` is parsed to get the timezone.
    +        filters (dict): If none provided, your report will span the last seven days.
    +        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}/tags/chat_usage',
    +                             json=payload,
    +                             headers=headers)
    +
    +
    def duration(self, distribution: str = None, timezone: str = None, filters: dict = None, payload: dict = None, headers: dict = None) ‑> httpx.Response
    @@ -1120,7 +1180,7 @@

    Returns

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/first_response_time', + return self.session.post(f'{self.api_url}/chats/first_response_time', json=payload, headers=headers) @@ -1440,7 +1500,7 @@

    Returns

    ''' if payload is None: payload = prepare_payload(locals()) - return self.session.post(f'{self.api_url}/agents/response_time', + return self.session.post(f'{self.api_url}/chats/response_time', json=payload, headers=headers) @@ -1569,66 +1629,6 @@

    Returns

    headers=headers) -
    -def tags_chat_usage(self, timezone: str = None, filters: dict = None, payload: dict = None, headers: dict = None) ‑> httpx.Response -
    -
    -

    Shows the total number of chats marked with each tag.

    -

    Args

    -
    -
    timezone : str
    -
    IANA Time Zone (e.g. America/Phoenix). -Defaults to the requester's timezone. -When the requester's timezone isn't present, then filters.from is parsed to get the timezone.
    -
    filters : dict
    -
    If none provided, your report will span the last seven days.
    -
    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 tags_chat_usage(self,
    -                    timezone: str = None,
    -                    filters: dict = None,
    -                    payload: dict = None,
    -                    headers: dict = None) -> httpx.Response:
    -    ''' Shows the total number of chats marked with each tag.
    -
    -    Args:
    -        timezone (str): IANA Time Zone (e.g. America/Phoenix).
    -                        Defaults to the requester's timezone.
    -                        When the requester's timezone isn't present, then `filters.from` is parsed to get the timezone.
    -        filters (dict): If none provided, your report will span the last seven days.
    -        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}/tags/chat_usage',
    -                             json=payload,
    -                             headers=headers)
    -
    -
    def total_chats(self, distribution: str = None, timezone: str = None, filters: dict = None, payload: dict = None, headers: dict = None) ‑> httpx.Response
    @@ -1715,6 +1715,7 @@

    Index

    ReportsApiV35

    diff --git a/docs/reports/base.html b/docs/reports/base.html index 05ced11..f511f2c 100644 --- a/docs/reports/base.html +++ b/docs/reports/base.html @@ -55,7 +55,9 @@

    Module livechat.reports.base

    token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[ReportsApiV33, ReportsApiV34, ReportsApiV35]: ''' Returns client for specific Reports API version. @@ -66,6 +68,11 @@

    Module livechat.reports.base

    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: ReportsApi: API client object for specified version. @@ -74,9 +81,9 @@

    Module livechat.reports.base

    ValueError: If the specified version does not exist. ''' client = { - '3.3': ReportsApiV33(token, base_url, http2), - '3.4': ReportsApiV34(token, base_url, http2), - '3.5': ReportsApiV35(token, base_url, http2), + '3.3': ReportsApiV33(token, base_url, http2, proxies, verify), + '3.4': ReportsApiV34(token, base_url, http2, proxies, verify), + '3.5': ReportsApiV35(token, base_url, http2, proxies, verify), }.get(version) if not client: raise ValueError('Provided version does not exist.') @@ -110,7 +117,9 @@

    Classes

    token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[ReportsApiV33, ReportsApiV34, ReportsApiV35]: ''' Returns client for specific Reports API version. @@ -121,6 +130,11 @@

    Classes

    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: ReportsApi: API client object for specified version. @@ -129,9 +143,9 @@

    Classes

    ValueError: If the specified version does not exist. ''' client = { - '3.3': ReportsApiV33(token, base_url, http2), - '3.4': ReportsApiV34(token, base_url, http2), - '3.5': ReportsApiV35(token, base_url, http2), + '3.3': ReportsApiV33(token, base_url, http2, proxies, verify), + '3.4': ReportsApiV34(token, base_url, http2, proxies, verify), + '3.5': ReportsApiV35(token, base_url, http2, proxies, verify), }.get(version) if not client: raise ValueError('Provided version does not exist.') @@ -140,7 +154,7 @@

    Classes

    Static methods

    -def get_client(token: str, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False) ‑> Union[ReportsApiV33ReportsApiV34ReportsApiV35] +def get_client(token: str, version: str = '3.4', base_url: str = 'api.livechatinc.com', http2: bool = False, proxies: dict = None, verify: bool = True) ‑> Union[ReportsApiV33ReportsApiV34ReportsApiV35]

    Returns client for specific Reports API version.

    @@ -156,6 +170,13 @@

    Args

    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

    @@ -176,7 +197,9 @@

    Raises

    token: str, version: str = stable_version, base_url: str = api_url, - http2: bool = False + http2: bool = False, + proxies: dict = None, + verify: bool = True ) -> Union[ReportsApiV33, ReportsApiV34, ReportsApiV35]: ''' Returns client for specific Reports API version. @@ -187,6 +210,11 @@

    Raises

    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: ReportsApi: API client object for specified version. @@ -195,9 +223,9 @@

    Raises

    ValueError: If the specified version does not exist. ''' client = { - '3.3': ReportsApiV33(token, base_url, http2), - '3.4': ReportsApiV34(token, base_url, http2), - '3.5': ReportsApiV35(token, base_url, http2), + '3.3': ReportsApiV33(token, base_url, http2, proxies, verify), + '3.4': ReportsApiV34(token, base_url, http2, proxies, verify), + '3.5': ReportsApiV35(token, base_url, http2, proxies, verify), }.get(version) if not client: raise ValueError('Provided version does not exist.')