# coding: utf-8 """ Copyright 2023 TikTok Pte. Ltd. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from business_api_client.api_client import ApiClient class EventCallbackApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def pixel_batch(self, access_token, **kwargs): # noqa: E501 """Pixel Track server-to-server batch api # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.pixel_batch(access_token, async_req=True) >>> result = thread.get() :param async_req bool :param str access_token: Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162). (required) :param PixelBatchBody body: Pixel batch update body parameters :return: InlineResponse200 If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.pixel_batch_with_http_info(access_token, **kwargs) # noqa: E501 else: (data) = self.pixel_batch_with_http_info(access_token, **kwargs) # noqa: E501 return data def pixel_batch_with_http_info(self, access_token, **kwargs): # noqa: E501 """Pixel Track server-to-server batch api # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.pixel_batch_with_http_info(access_token, async_req=True) >>> result = thread.get() :param async_req bool :param str access_token: Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162). (required) :param PixelBatchBody body: Pixel batch update body parameters :return: InlineResponse200 If the method is called asynchronously, returns the request thread. """ all_params = ['access_token', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method pixel_batch" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'access_token' is set if ('access_token' not in params or params['access_token'] is None): raise ValueError("Missing the required parameter `access_token` when calling `pixel_batch`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} if 'access_token' in params: header_params['Access-Token'] = params['access_token'] # noqa: E501 form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/open_api/v1.3/pixel/batch/', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='InlineResponse200', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def pixel_track(self, access_token, **kwargs): # noqa: E501 """Pixel Track server-to-server api # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.pixel_track(access_token, async_req=True) >>> result = thread.get() :param async_req bool :param str access_token: Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162). (required) :param PixelTrackBody body: Pixel track body parameters :return: InlineResponse200 If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.pixel_track_with_http_info(access_token, **kwargs) # noqa: E501 else: (data) = self.pixel_track_with_http_info(access_token, **kwargs) # noqa: E501 return data def pixel_track_with_http_info(self, access_token, **kwargs): # noqa: E501 """Pixel Track server-to-server api # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.pixel_track_with_http_info(access_token, async_req=True) >>> result = thread.get() :param async_req bool :param str access_token: Authorized access token. For details, see [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162). (required) :param PixelTrackBody body: Pixel track body parameters :return: InlineResponse200 If the method is called asynchronously, returns the request thread. """ all_params = ['access_token', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method pixel_track" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'access_token' is set if ('access_token' not in params or params['access_token'] is None): raise ValueError("Missing the required parameter `access_token` when calling `pixel_track`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} if 'access_token' in params: header_params['Access-Token'] = params['access_token'] # noqa: E501 form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/open_api/v1.3/pixel/track/', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='InlineResponse200', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)