@@ -1692,7 +1692,6 @@ def unban_customer(self,
16921692 json = payload ,
16931693 headers = headers )
16941694
1695-
16961695# Batch requests
16971696
16981697 def batch_create_agents (self ,
@@ -1865,3 +1864,168 @@ def batch_update_bots(self,
18651864 return self .session .post (f'{ self .api_url } /batch_update_bots' ,
18661865 json = payload ,
18671866 headers = headers )
1867+
1868+
1869+ # Greetings
1870+
1871+ def create_greeting (self ,
1872+ type : str = None ,
1873+ active : bool = None ,
1874+ active_from : str = None ,
1875+ active_until : str = None ,
1876+ name : str = None ,
1877+ group : int = None ,
1878+ rules : list = None ,
1879+ properties : dict = None ,
1880+ rich_message : dict = None ,
1881+ payload : dict = None ,
1882+ headers : dict = None ) -> httpx .Response :
1883+ ''' Creates a new greeting.
1884+
1885+ Args:
1886+ type (str): Greeting type.
1887+ active (bool): Whether the greeting is active.
1888+ active_from (str): RFC 3339 date-time format; when the greeting becomes active.
1889+ active_until (str): RFC 3339 date-time format; when the greeting stops being active.
1890+ name (str): Greeting name.
1891+ group (int): Group ID the greeting belongs to; the group must exist.
1892+ rules (list): Array of action rules that define when the greeting should be triggered.
1893+ At least one rule is required. Each rule should contain:
1894+ - condition (str): Logical condition for the rule.
1895+ - type (str): Type of rule condition.
1896+ - operator (str): Comparison operator for the rule (required for most types).
1897+ - value (str): Value to compare against (required for most rule types).
1898+ - urls (list): Array of URLs (required only for url_funnel type).
1899+ - session_field (dict): Key-value pairs (required for custom_variable and ads_traffic types).
1900+ properties (dict): Additional properties for the greeting as key-value pairs.
1901+ rich_message (dict): Rich message content of the greeting.
1902+ payload (dict): Custom payload to be used as request's data.
1903+ It overrides all other parameters provided for the method.
1904+ headers (dict): Custom headers to be used with session headers.
1905+ They will be merged with session-level values that are set,
1906+ however, these method-level parameters will not be persisted across requests.
1907+
1908+ Returns:
1909+ httpx.Response: The Response object from `httpx` library,
1910+ which contains a server's response to an HTTP request.
1911+ '''
1912+ if payload is None :
1913+ payload = prepare_payload (locals ())
1914+ return self .session .post (f'{ self .api_url } /create_greeting' ,
1915+ json = payload ,
1916+ headers = headers )
1917+
1918+ def delete_greeting (self ,
1919+ id : int = None ,
1920+ payload : dict = None ,
1921+ headers : dict = None ) -> httpx .Response :
1922+ ''' Deletes a greeting.
1923+
1924+ Args:
1925+ id (int): ID of the greeting to delete.
1926+ payload (dict): Custom payload to be used as request's data.
1927+ It overrides all other parameters provided for the method.
1928+ headers (dict): Custom headers to be used with session headers.
1929+ They will be merged with session-level values that are set,
1930+ however, these method-level parameters will not be persisted across requests.
1931+
1932+ Returns:
1933+ httpx.Response: The Response object from `httpx` library,
1934+ which contains a server's response to an HTTP request.
1935+ '''
1936+ if payload is None :
1937+ payload = prepare_payload (locals ())
1938+ return self .session .post (f'{ self .api_url } /delete_greeting' ,
1939+ json = payload ,
1940+ headers = headers )
1941+
1942+ def get_greeting (self ,
1943+ id : int = None ,
1944+ payload : dict = None ,
1945+ headers : dict = None ) -> httpx .Response :
1946+ ''' Gets a greeting details.
1947+
1948+ Args:
1949+ id (int): ID of the greeting to get.
1950+ payload (dict): Custom payload to be used as request's data.
1951+ It overrides all other parameters provided for the method.
1952+ headers (dict): Custom headers to be used with session headers.
1953+ They will be merged with session-level values that are set,
1954+ however, these method-level parameters will not be persisted across requests.
1955+
1956+ Returns:
1957+ httpx.Response: The Response object from `httpx` library,
1958+ which contains a server's response to an HTTP request.
1959+ '''
1960+ if payload is None :
1961+ payload = prepare_payload (locals ())
1962+ return self .session .post (f'{ self .api_url } /get_greeting' ,
1963+ json = payload ,
1964+ headers = headers )
1965+
1966+ def list_greetings (self ,
1967+ groups : list = None ,
1968+ page_id : str = None ,
1969+ limit : int = None ,
1970+ payload : dict = None ,
1971+ headers : dict = None ) -> httpx .Response :
1972+ ''' Returns a list of greetings, optionally filtered by groups.
1973+ The method supports pagination to handle large result sets.
1974+
1975+ Args:
1976+ groups (list): Array of group IDs to filter greetings. Must contain non-negative integers.
1977+ page_id (str): Page ID for pagination.
1978+ limit (int): Number of greetings per page. Must be between 1 and 100. Defaults to 100.
1979+ payload (dict): Custom payload to be used as request's data.
1980+ It overrides all other parameters provided for the method.
1981+ headers (dict): Custom headers to be used with session headers.
1982+ They will be merged with session-level values that are set,
1983+ however, these method-level parameters will not be persisted across requests.
1984+
1985+ Returns:
1986+ httpx.Response: The Response object from `httpx` library,
1987+ which contains a server's response to an HTTP request.
1988+ '''
1989+ if payload is None :
1990+ payload = prepare_payload (locals ())
1991+ return self .session .post (f'{ self .api_url } /list_greetings' ,
1992+ json = payload ,
1993+ headers = headers )
1994+
1995+ def update_greeting (self ,
1996+ id : int = None ,
1997+ active : bool = None ,
1998+ active_from : str = None ,
1999+ active_until : str = None ,
2000+ name : str = None ,
2001+ rules : list = None ,
2002+ properties : dict = None ,
2003+ rich_message : dict = None ,
2004+ payload : dict = None ,
2005+ headers : dict = None ) -> httpx .Response :
2006+ ''' Updates an existing greeting.
2007+
2008+ Args:
2009+ id (int): ID of the greeting to update.
2010+ active (bool): Whether the greeting is active.
2011+ active_from (str): RFC 3339 date-time format; when the greeting becomes active.
2012+ active_until (str): RFC 3339 date-time format; when the greeting stops being active.
2013+ name (str): Greeting name (cannot be empty if provided).
2014+ rules (list): Array of action rules.
2015+ properties (dict): Additional properties for the greeting as key-value pairs.
2016+ rich_message (dict): Rich message content of the greeting.
2017+ payload (dict): Custom payload to be used as request's data.
2018+ It overrides all other parameters provided for the method.
2019+ headers (dict): Custom headers to be used with session headers.
2020+ They will be merged with session-level values that are set,
2021+ however, these method-level parameters will not be persisted across requests.
2022+
2023+ Returns:
2024+ httpx.Response: The Response object from `httpx` library,
2025+ which contains a server's response to an HTTP request.
2026+ '''
2027+ if payload is None :
2028+ payload = prepare_payload (locals ())
2029+ return self .session .post (f'{ self .api_url } /update_greeting' ,
2030+ json = payload ,
2031+ headers = headers )
0 commit comments