|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Segment Public API |
| 5 | +
|
| 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 | +
|
| 8 | + The version of the OpenAPI document: 58.5.0 |
| 9 | + |
| 10 | + Generated by OpenAPI Generator (https://openapi-generator.tech) |
| 11 | +
|
| 12 | + Do not edit the class manually. |
| 13 | +""" # noqa: E501 |
| 14 | + |
| 15 | + |
| 16 | +import re # noqa: F401 |
| 17 | +import io |
| 18 | +import warnings |
| 19 | + |
| 20 | +from pydantic import validate_arguments, ValidationError |
| 21 | + |
| 22 | +from segment_public_api.models.create_download200_response import CreateDownload200Response |
| 23 | +from segment_public_api.models.create_download_alpha_input import CreateDownloadAlphaInput |
| 24 | + |
| 25 | +from segment_public_api.api_client import ApiClient |
| 26 | +from segment_public_api.api_response import ApiResponse |
| 27 | +from segment_public_api.exceptions import ( # noqa: F401 |
| 28 | + ApiTypeError, |
| 29 | + ApiValueError |
| 30 | +) |
| 31 | + |
| 32 | + |
| 33 | +class CustomerInsightsApi: |
| 34 | + """NOTE: This class is auto generated by OpenAPI Generator |
| 35 | + Ref: https://openapi-generator.tech |
| 36 | +
|
| 37 | + Do not edit the class manually. |
| 38 | + """ |
| 39 | + |
| 40 | + def __init__(self, api_client=None) -> None: |
| 41 | + if api_client is None: |
| 42 | + api_client = ApiClient.get_default() |
| 43 | + self.api_client = api_client |
| 44 | + |
| 45 | + @validate_arguments |
| 46 | + def create_download(self, create_download_alpha_input : CreateDownloadAlphaInput, **kwargs) -> CreateDownload200Response: # noqa: E501 |
| 47 | + """Create Download # noqa: E501 |
| 48 | +
|
| 49 | + Create Customer Insights Presigned URLs The rate limit for this endpoint is 1 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. # noqa: E501 |
| 50 | + This method makes a synchronous HTTP request by default. To make an |
| 51 | + asynchronous HTTP request, please pass async_req=True |
| 52 | +
|
| 53 | + >>> thread = api.create_download(create_download_alpha_input, async_req=True) |
| 54 | + >>> result = thread.get() |
| 55 | +
|
| 56 | + :param create_download_alpha_input: (required) |
| 57 | + :type create_download_alpha_input: CreateDownloadAlphaInput |
| 58 | + :param async_req: Whether to execute the request asynchronously. |
| 59 | + :type async_req: bool, optional |
| 60 | + :param _request_timeout: timeout setting for this request. |
| 61 | + If one number provided, it will be total request |
| 62 | + timeout. It can also be a pair (tuple) of |
| 63 | + (connection, read) timeouts. |
| 64 | + :return: Returns the result object. |
| 65 | + If the method is called asynchronously, |
| 66 | + returns the request thread. |
| 67 | + :rtype: CreateDownload200Response |
| 68 | + """ |
| 69 | + kwargs['_return_http_data_only'] = True |
| 70 | + if '_preload_content' in kwargs: |
| 71 | + message = "Error! Please call the create_download_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 |
| 72 | + raise ValueError(message) |
| 73 | + return self.create_download_with_http_info(create_download_alpha_input, **kwargs) # noqa: E501 |
| 74 | + |
| 75 | + @validate_arguments |
| 76 | + def create_download_with_http_info(self, create_download_alpha_input : CreateDownloadAlphaInput, **kwargs) -> ApiResponse: # noqa: E501 |
| 77 | + """Create Download # noqa: E501 |
| 78 | +
|
| 79 | + Create Customer Insights Presigned URLs The rate limit for this endpoint is 1 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. # noqa: E501 |
| 80 | + This method makes a synchronous HTTP request by default. To make an |
| 81 | + asynchronous HTTP request, please pass async_req=True |
| 82 | +
|
| 83 | + >>> thread = api.create_download_with_http_info(create_download_alpha_input, async_req=True) |
| 84 | + >>> result = thread.get() |
| 85 | +
|
| 86 | + :param create_download_alpha_input: (required) |
| 87 | + :type create_download_alpha_input: CreateDownloadAlphaInput |
| 88 | + :param async_req: Whether to execute the request asynchronously. |
| 89 | + :type async_req: bool, optional |
| 90 | + :param _preload_content: if False, the ApiResponse.data will |
| 91 | + be set to none and raw_data will store the |
| 92 | + HTTP response body without reading/decoding. |
| 93 | + Default is True. |
| 94 | + :type _preload_content: bool, optional |
| 95 | + :param _return_http_data_only: response data instead of ApiResponse |
| 96 | + object with status code, headers, etc |
| 97 | + :type _return_http_data_only: bool, optional |
| 98 | + :param _request_timeout: timeout setting for this request. If one |
| 99 | + number provided, it will be total request |
| 100 | + timeout. It can also be a pair (tuple) of |
| 101 | + (connection, read) timeouts. |
| 102 | + :param _request_auth: set to override the auth_settings for an a single |
| 103 | + request; this effectively ignores the authentication |
| 104 | + in the spec for a single request. |
| 105 | + :type _request_auth: dict, optional |
| 106 | + :type _content_type: string, optional: force content-type for the request |
| 107 | + :return: Returns the result object. |
| 108 | + If the method is called asynchronously, |
| 109 | + returns the request thread. |
| 110 | + :rtype: tuple(CreateDownload200Response, status_code(int), headers(HTTPHeaderDict)) |
| 111 | + """ |
| 112 | + |
| 113 | + _params = locals() |
| 114 | + |
| 115 | + _all_params = [ |
| 116 | + 'create_download_alpha_input' |
| 117 | + ] |
| 118 | + _all_params.extend( |
| 119 | + [ |
| 120 | + 'async_req', |
| 121 | + '_return_http_data_only', |
| 122 | + '_preload_content', |
| 123 | + '_request_timeout', |
| 124 | + '_request_auth', |
| 125 | + '_content_type', |
| 126 | + '_headers' |
| 127 | + ] |
| 128 | + ) |
| 129 | + |
| 130 | + # validate the arguments |
| 131 | + for _key, _val in _params['kwargs'].items(): |
| 132 | + if _key not in _all_params: |
| 133 | + raise ApiTypeError( |
| 134 | + "Got an unexpected keyword argument '%s'" |
| 135 | + " to method create_download" % _key |
| 136 | + ) |
| 137 | + _params[_key] = _val |
| 138 | + del _params['kwargs'] |
| 139 | + |
| 140 | + _collection_formats = {} |
| 141 | + |
| 142 | + # process the path parameters |
| 143 | + _path_params = {} |
| 144 | + |
| 145 | + # process the query parameters |
| 146 | + _query_params = [] |
| 147 | + # process the header parameters |
| 148 | + _header_params = dict(_params.get('_headers', {})) |
| 149 | + # process the form parameters |
| 150 | + _form_params = [] |
| 151 | + _files = {} |
| 152 | + # process the body parameter |
| 153 | + _body_params = None |
| 154 | + if _params['create_download_alpha_input'] is not None: |
| 155 | + _body_params = _params['create_download_alpha_input'] |
| 156 | + |
| 157 | + # set the HTTP header `Accept` |
| 158 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 159 | + ['application/vnd.segment.v1alpha+json', 'application/json']) # noqa: E501 |
| 160 | + |
| 161 | + # set the HTTP header `Content-Type` |
| 162 | + _content_types_list = _params.get('_content_type', |
| 163 | + self.api_client.select_header_content_type( |
| 164 | + ['application/vnd.segment.v1alpha+json'])) |
| 165 | + if _content_types_list: |
| 166 | + _header_params['Content-Type'] = _content_types_list |
| 167 | + |
| 168 | + # authentication setting |
| 169 | + _auth_settings = ['token'] # noqa: E501 |
| 170 | + |
| 171 | + _response_types_map = { |
| 172 | + '200': "CreateDownload200Response", |
| 173 | + '404': "RequestErrorEnvelope", |
| 174 | + '422': "RequestErrorEnvelope", |
| 175 | + '429': "RequestErrorEnvelope", |
| 176 | + } |
| 177 | + |
| 178 | + return self.api_client.call_api( |
| 179 | + '/customer-insights/download', 'POST', |
| 180 | + _path_params, |
| 181 | + _query_params, |
| 182 | + _header_params, |
| 183 | + body=_body_params, |
| 184 | + post_params=_form_params, |
| 185 | + files=_files, |
| 186 | + response_types_map=_response_types_map, |
| 187 | + auth_settings=_auth_settings, |
| 188 | + async_req=_params.get('async_req'), |
| 189 | + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 |
| 190 | + _preload_content=_params.get('_preload_content', True), |
| 191 | + _request_timeout=_params.get('_request_timeout'), |
| 192 | + collection_formats=_collection_formats, |
| 193 | + _request_auth=_params.get('_request_auth')) |
0 commit comments