|
5 | 5 |
|
6 | 6 | The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API.
|
7 | 7 |
|
8 |
| - The version of the OpenAPI document: 59.4.0 |
| 8 | + The version of the OpenAPI document: 59.5.0 |
9 | 9 |
|
10 | 10 | Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11 | 11 |
|
|
43 | 43 | from segment_public_api.models.remove_audience_from_space200_response import RemoveAudienceFromSpace200Response
|
44 | 44 | from segment_public_api.models.update_audience_for_space200_response import UpdateAudienceForSpace200Response
|
45 | 45 | from segment_public_api.models.update_audience_for_space_alpha_input import UpdateAudienceForSpaceAlphaInput
|
| 46 | +from segment_public_api.models.update_audience_schedule_for_audience200_response import UpdateAudienceScheduleForAudience200Response |
| 47 | +from segment_public_api.models.update_audience_schedule_for_audience_alpha_input import UpdateAudienceScheduleForAudienceAlphaInput |
46 | 48 |
|
47 | 49 | from segment_public_api.api_client import ApiClient
|
48 | 50 | from segment_public_api.api_response import ApiResponse
|
@@ -1824,3 +1826,177 @@ def update_audience_for_space_with_http_info(self, space_id : constr(strict=True
|
1824 | 1826 | _request_timeout=_params.get('_request_timeout'),
|
1825 | 1827 | collection_formats=_collection_formats,
|
1826 | 1828 | _request_auth=_params.get('_request_auth'))
|
| 1829 | + |
| 1830 | + @validate_arguments |
| 1831 | + def update_audience_schedule_for_audience(self, space_id : constr(strict=True), id : constr(strict=True), schedule_id : constr(strict=True), update_audience_schedule_for_audience_alpha_input : UpdateAudienceScheduleForAudienceAlphaInput, **kwargs) -> UpdateAudienceScheduleForAudience200Response: # noqa: E501 |
| 1832 | + """Update Audience Schedule for Audience # noqa: E501 |
| 1833 | +
|
| 1834 | + Updates an audience schedule for a Linked Audience (audienceType = LINKED). • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to [email protected]. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. # noqa: E501 |
| 1835 | + This method makes a synchronous HTTP request by default. To make an |
| 1836 | + asynchronous HTTP request, please pass async_req=True |
| 1837 | +
|
| 1838 | + >>> thread = api.update_audience_schedule_for_audience(space_id, id, schedule_id, update_audience_schedule_for_audience_alpha_input, async_req=True) |
| 1839 | + >>> result = thread.get() |
| 1840 | +
|
| 1841 | + :param space_id: (required) |
| 1842 | + :type space_id: str |
| 1843 | + :param id: (required) |
| 1844 | + :type id: str |
| 1845 | + :param schedule_id: (required) |
| 1846 | + :type schedule_id: str |
| 1847 | + :param update_audience_schedule_for_audience_alpha_input: (required) |
| 1848 | + :type update_audience_schedule_for_audience_alpha_input: UpdateAudienceScheduleForAudienceAlphaInput |
| 1849 | + :param async_req: Whether to execute the request asynchronously. |
| 1850 | + :type async_req: bool, optional |
| 1851 | + :param _request_timeout: timeout setting for this request. |
| 1852 | + If one number provided, it will be total request |
| 1853 | + timeout. It can also be a pair (tuple) of |
| 1854 | + (connection, read) timeouts. |
| 1855 | + :return: Returns the result object. |
| 1856 | + If the method is called asynchronously, |
| 1857 | + returns the request thread. |
| 1858 | + :rtype: UpdateAudienceScheduleForAudience200Response |
| 1859 | + """ |
| 1860 | + kwargs['_return_http_data_only'] = True |
| 1861 | + if '_preload_content' in kwargs: |
| 1862 | + message = "Error! Please call the update_audience_schedule_for_audience_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 |
| 1863 | + raise ValueError(message) |
| 1864 | + return self.update_audience_schedule_for_audience_with_http_info(space_id, id, schedule_id, update_audience_schedule_for_audience_alpha_input, **kwargs) # noqa: E501 |
| 1865 | + |
| 1866 | + @validate_arguments |
| 1867 | + def update_audience_schedule_for_audience_with_http_info(self, space_id : constr(strict=True), id : constr(strict=True), schedule_id : constr(strict=True), update_audience_schedule_for_audience_alpha_input : UpdateAudienceScheduleForAudienceAlphaInput, **kwargs) -> ApiResponse: # noqa: E501 |
| 1868 | + """Update Audience Schedule for Audience # noqa: E501 |
| 1869 | +
|
| 1870 | + Updates an audience schedule for a Linked Audience (audienceType = LINKED). • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to [email protected]. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. # noqa: E501 |
| 1871 | + This method makes a synchronous HTTP request by default. To make an |
| 1872 | + asynchronous HTTP request, please pass async_req=True |
| 1873 | +
|
| 1874 | + >>> thread = api.update_audience_schedule_for_audience_with_http_info(space_id, id, schedule_id, update_audience_schedule_for_audience_alpha_input, async_req=True) |
| 1875 | + >>> result = thread.get() |
| 1876 | +
|
| 1877 | + :param space_id: (required) |
| 1878 | + :type space_id: str |
| 1879 | + :param id: (required) |
| 1880 | + :type id: str |
| 1881 | + :param schedule_id: (required) |
| 1882 | + :type schedule_id: str |
| 1883 | + :param update_audience_schedule_for_audience_alpha_input: (required) |
| 1884 | + :type update_audience_schedule_for_audience_alpha_input: UpdateAudienceScheduleForAudienceAlphaInput |
| 1885 | + :param async_req: Whether to execute the request asynchronously. |
| 1886 | + :type async_req: bool, optional |
| 1887 | + :param _preload_content: if False, the ApiResponse.data will |
| 1888 | + be set to none and raw_data will store the |
| 1889 | + HTTP response body without reading/decoding. |
| 1890 | + Default is True. |
| 1891 | + :type _preload_content: bool, optional |
| 1892 | + :param _return_http_data_only: response data instead of ApiResponse |
| 1893 | + object with status code, headers, etc |
| 1894 | + :type _return_http_data_only: bool, optional |
| 1895 | + :param _request_timeout: timeout setting for this request. If one |
| 1896 | + number provided, it will be total request |
| 1897 | + timeout. It can also be a pair (tuple) of |
| 1898 | + (connection, read) timeouts. |
| 1899 | + :param _request_auth: set to override the auth_settings for an a single |
| 1900 | + request; this effectively ignores the authentication |
| 1901 | + in the spec for a single request. |
| 1902 | + :type _request_auth: dict, optional |
| 1903 | + :type _content_type: string, optional: force content-type for the request |
| 1904 | + :return: Returns the result object. |
| 1905 | + If the method is called asynchronously, |
| 1906 | + returns the request thread. |
| 1907 | + :rtype: tuple(UpdateAudienceScheduleForAudience200Response, status_code(int), headers(HTTPHeaderDict)) |
| 1908 | + """ |
| 1909 | + |
| 1910 | + _params = locals() |
| 1911 | + |
| 1912 | + _all_params = [ |
| 1913 | + 'space_id', |
| 1914 | + 'id', |
| 1915 | + 'schedule_id', |
| 1916 | + 'update_audience_schedule_for_audience_alpha_input' |
| 1917 | + ] |
| 1918 | + _all_params.extend( |
| 1919 | + [ |
| 1920 | + 'async_req', |
| 1921 | + '_return_http_data_only', |
| 1922 | + '_preload_content', |
| 1923 | + '_request_timeout', |
| 1924 | + '_request_auth', |
| 1925 | + '_content_type', |
| 1926 | + '_headers' |
| 1927 | + ] |
| 1928 | + ) |
| 1929 | + |
| 1930 | + # validate the arguments |
| 1931 | + for _key, _val in _params['kwargs'].items(): |
| 1932 | + if _key not in _all_params: |
| 1933 | + raise ApiTypeError( |
| 1934 | + "Got an unexpected keyword argument '%s'" |
| 1935 | + " to method update_audience_schedule_for_audience" % _key |
| 1936 | + ) |
| 1937 | + _params[_key] = _val |
| 1938 | + del _params['kwargs'] |
| 1939 | + |
| 1940 | + _collection_formats = {} |
| 1941 | + |
| 1942 | + # process the path parameters |
| 1943 | + _path_params = {} |
| 1944 | + if _params['space_id']: |
| 1945 | + _path_params['spaceId'] = _params['space_id'] |
| 1946 | + |
| 1947 | + if _params['id']: |
| 1948 | + _path_params['id'] = _params['id'] |
| 1949 | + |
| 1950 | + if _params['schedule_id']: |
| 1951 | + _path_params['scheduleId'] = _params['schedule_id'] |
| 1952 | + |
| 1953 | + |
| 1954 | + # process the query parameters |
| 1955 | + _query_params = [] |
| 1956 | + # process the header parameters |
| 1957 | + _header_params = dict(_params.get('_headers', {})) |
| 1958 | + # process the form parameters |
| 1959 | + _form_params = [] |
| 1960 | + _files = {} |
| 1961 | + # process the body parameter |
| 1962 | + _body_params = None |
| 1963 | + if _params['update_audience_schedule_for_audience_alpha_input'] is not None: |
| 1964 | + _body_params = _params['update_audience_schedule_for_audience_alpha_input'] |
| 1965 | + |
| 1966 | + # set the HTTP header `Accept` |
| 1967 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 1968 | + ['application/vnd.segment.v1alpha+json', 'application/json']) # noqa: E501 |
| 1969 | + |
| 1970 | + # set the HTTP header `Content-Type` |
| 1971 | + _content_types_list = _params.get('_content_type', |
| 1972 | + self.api_client.select_header_content_type( |
| 1973 | + ['application/vnd.segment.v1alpha+json'])) |
| 1974 | + if _content_types_list: |
| 1975 | + _header_params['Content-Type'] = _content_types_list |
| 1976 | + |
| 1977 | + # authentication setting |
| 1978 | + _auth_settings = ['token'] # noqa: E501 |
| 1979 | + |
| 1980 | + _response_types_map = { |
| 1981 | + '200': "UpdateAudienceScheduleForAudience200Response", |
| 1982 | + '404': "RequestErrorEnvelope", |
| 1983 | + '422': "RequestErrorEnvelope", |
| 1984 | + '429': "RequestErrorEnvelope", |
| 1985 | + } |
| 1986 | + |
| 1987 | + return self.api_client.call_api( |
| 1988 | + '/spaces/{spaceId}/audiences/{id}/schedules/{scheduleId}', 'PATCH', |
| 1989 | + _path_params, |
| 1990 | + _query_params, |
| 1991 | + _header_params, |
| 1992 | + body=_body_params, |
| 1993 | + post_params=_form_params, |
| 1994 | + files=_files, |
| 1995 | + response_types_map=_response_types_map, |
| 1996 | + auth_settings=_auth_settings, |
| 1997 | + async_req=_params.get('async_req'), |
| 1998 | + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 |
| 1999 | + _preload_content=_params.get('_preload_content', True), |
| 2000 | + _request_timeout=_params.get('_request_timeout'), |
| 2001 | + collection_formats=_collection_formats, |
| 2002 | + _request_auth=_params.get('_request_auth')) |
0 commit comments