def get_campaign_blueprint_with_http_info(self, blueprint_id, **kwargs): # noqa: E501 """Get a campaign blueprint # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_campaign_blueprint_with_http_info(blueprint_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int blueprint_id: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(CampaignBlueprintResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['blueprint_id'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_campaign_blueprint" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'blueprint_id' is set if self.api_client.client_side_validation and ( 'blueprint_id' not in local_var_params or # noqa: E501 local_var_params['blueprint_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `blueprint_id` when calling `get_campaign_blueprint`" ) # noqa: E501 collection_formats = {} path_params = {} if 'blueprint_id' in local_var_params: path_params['blueprint_id'] = local_var_params[ 'blueprint_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2PasswordBearer'] # noqa: E501 return self.api_client.call_api( '/campaign-blueprints/{blueprint_id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='CampaignBlueprintResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def create_custom_attribute_with_http_info(self, list_id, create_custom_attribute, **kwargs): # noqa: E501 """Create a custom attribute # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_custom_attribute_with_http_info(list_id, create_custom_attribute, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int list_id: (required) :param CreateCustomAttribute create_custom_attribute: (required) :param int account_id: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(CreateAttributeResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'list_id', 'create_custom_attribute', 'account_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_custom_attribute" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'list_id' is set if self.api_client.client_side_validation and ('list_id' not in local_var_params or # noqa: E501 local_var_params['list_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `list_id` when calling `create_custom_attribute`") # noqa: E501 # verify the required parameter 'create_custom_attribute' is set if self.api_client.client_side_validation and ('create_custom_attribute' not in local_var_params or # noqa: E501 local_var_params['create_custom_attribute'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `create_custom_attribute` when calling `create_custom_attribute`") # noqa: E501 if self.api_client.client_side_validation and 'list_id' in local_var_params and local_var_params['list_id'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `list_id` when calling `create_custom_attribute`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} if 'list_id' in local_var_params: path_params['list_id'] = local_var_params['list_id'] # noqa: E501 query_params = [] if 'account_id' in local_var_params and local_var_params['account_id'] is not None: # noqa: E501 query_params.append(('account_id', local_var_params['account_id'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None if 'create_custom_attribute' in local_var_params: body_params = local_var_params['create_custom_attribute'] # 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 = ['OAuth2PasswordBearer'] # noqa: E501 return self.api_client.call_api( '/lists/{list_id}/custom-attributes', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='CreateAttributeResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def list_campaign_blueprints_with_http_info(self, **kwargs): # noqa: E501 """Show all campaign blueprints # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_campaign_blueprints_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int page: :param int per_page: :param bool with_count: :param str filter: Valid Terms: - `tag` - `name` Valid Operators: - `==` Query separator: - `;` :param str sort: Sort term and direction, using syntax `[-|+]term`. Valid terms: - `id` - `created_on` - `updated_on` - `name` :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(CampaignBlueprintsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['page', 'per_page', 'with_count', 'filter', 'sort'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_campaign_blueprints" % key) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'page' in local_var_params and local_var_params[ 'page'] is not None: # noqa: E501 query_params.append( ('page', local_var_params['page'])) # noqa: E501 if 'per_page' in local_var_params and local_var_params[ 'per_page'] is not None: # noqa: E501 query_params.append( ('per_page', local_var_params['per_page'])) # noqa: E501 if 'with_count' in local_var_params and local_var_params[ 'with_count'] is not None: # noqa: E501 query_params.append( ('with_count', local_var_params['with_count'])) # noqa: E501 if 'filter' in local_var_params and local_var_params[ 'filter'] is not None: # noqa: E501 query_params.append( ('filter', local_var_params['filter'])) # noqa: E501 if 'sort' in local_var_params and local_var_params[ 'sort'] is not None: # noqa: E501 query_params.append( ('sort', local_var_params['sort'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2PasswordBearer'] # noqa: E501 return self.api_client.call_api( '/campaign-blueprints', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='CampaignBlueprintsResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def resend_account_verification_with_http_info(self, resend_verification_email, **kwargs): # noqa: E501 """Resend the account verification email # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.resend_account_verification_with_http_info(resend_verification_email, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param ResendVerificationEmail resend_verification_email: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(ResendAccountVerificationEmailResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'resend_verification_email' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method resend_account_verification" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'resend_verification_email' is set if self.api_client.client_side_validation and ('resend_verification_email' not in local_var_params or # noqa: E501 local_var_params['resend_verification_email'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `resend_verification_email` when calling `resend_account_verification`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'resend_verification_email' in local_var_params: body_params = local_var_params['resend_verification_email'] # 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( '/accounts/resend-verification-email', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ResendAccountVerificationEmailResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def delete_suppressed_email_with_http_info(self, email, **kwargs): # noqa: E501 """Delete a suppressed email # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_suppressed_email_with_http_info(email, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str email: Full email, a local part wildcard or a domain wildcard. Examples: *@domain.com, john@*, [email protected] (required) :param int account_id: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(DeleteSuppressedEmailResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'email', 'account_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_suppressed_email" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'email' is set if self.api_client.client_side_validation and ('email' not in local_var_params or # noqa: E501 local_var_params['email'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `email` when calling `delete_suppressed_email`") # noqa: E501 if self.api_client.client_side_validation and 'email' in local_var_params and not re.search(r'(^\*@[^@*]+\.[^@*]+$|^[^@*]+@\*$|^[^@*]+@[^@*]+\.[^@*]+$)', local_var_params['email']): # noqa: E501 raise ApiValueError("Invalid value for parameter `email` when calling `delete_suppressed_email`, must conform to the pattern `/(^\*@[^@*]+\.[^@*]+$|^[^@*]+@\*$|^[^@*]+@[^@*]+\.[^@*]+$)/`") # noqa: E501 collection_formats = {} path_params = {} if 'email' in local_var_params: path_params['email'] = local_var_params['email'] # noqa: E501 query_params = [] if 'account_id' in local_var_params and local_var_params['account_id'] is not None: # noqa: E501 query_params.append(('account_id', local_var_params['account_id'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2PasswordBearer'] # noqa: E501 return self.api_client.call_api( '/suppressed-emails/{email}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='DeleteSuppressedEmailResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def get_action_logs_with_http_info(self, workflow_id, action_id, **kwargs): # noqa: E501 """Show action logs # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_action_logs_with_http_info(workflow_id, action_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str workflow_id: (required) :param str action_id: (required) :param int account_id: :param int start_time: :param int end_time: :param int page: :param int per_page: :param bool with_count: :param str filter: Valid Terms: - `additional_info` - `link_id` - `contact_id` - `email` - `log_id` - `track_id` - `type` Valid Operators: - `==` Query separator: - `;` :param str sort: Sort term and direction, using syntax `[-|+]term`. Valid terms: - `time` - `log_id` :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(ActionLogsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'workflow_id', 'action_id', 'account_id', 'start_time', 'end_time', 'page', 'per_page', 'with_count', 'filter', 'sort' ] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_action_logs" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'workflow_id' is set if self.api_client.client_side_validation and ( 'workflow_id' not in local_var_params or # noqa: E501 local_var_params['workflow_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `workflow_id` when calling `get_action_logs`" ) # noqa: E501 # verify the required parameter 'action_id' is set if self.api_client.client_side_validation and ( 'action_id' not in local_var_params or # noqa: E501 local_var_params['action_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `action_id` when calling `get_action_logs`" ) # noqa: E501 if self.api_client.client_side_validation and 'start_time' in local_var_params and local_var_params[ 'start_time'] > 2147483647: # noqa: E501 raise ApiValueError( "Invalid value for parameter `start_time` when calling `get_action_logs`, must be a value less than or equal to `2147483647`" ) # noqa: E501 if self.api_client.client_side_validation and 'start_time' in local_var_params and local_var_params[ 'start_time'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `start_time` when calling `get_action_logs`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'end_time' in local_var_params and local_var_params[ 'end_time'] > 2147483647: # noqa: E501 raise ApiValueError( "Invalid value for parameter `end_time` when calling `get_action_logs`, must be a value less than or equal to `2147483647`" ) # noqa: E501 if self.api_client.client_side_validation and 'end_time' in local_var_params and local_var_params[ 'end_time'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `end_time` when calling `get_action_logs`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params[ 'page'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `page` when calling `get_action_logs`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'per_page' in local_var_params and local_var_params[ 'per_page'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `per_page` when calling `get_action_logs`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'sort' in local_var_params and not re.search( r'[-|+]?.*', local_var_params['sort']): # noqa: E501 raise ApiValueError( "Invalid value for parameter `sort` when calling `get_action_logs`, must conform to the pattern `/[-|+]?.*/`" ) # noqa: E501 collection_formats = {} path_params = {} if 'workflow_id' in local_var_params: path_params['workflow_id'] = local_var_params[ 'workflow_id'] # noqa: E501 if 'action_id' in local_var_params: path_params['action_id'] = local_var_params[ 'action_id'] # noqa: E501 query_params = [] if 'account_id' in local_var_params and local_var_params[ 'account_id'] is not None: # noqa: E501 query_params.append( ('account_id', local_var_params['account_id'])) # noqa: E501 if 'start_time' in local_var_params and local_var_params[ 'start_time'] is not None: # noqa: E501 query_params.append( ('start_time', local_var_params['start_time'])) # noqa: E501 if 'end_time' in local_var_params and local_var_params[ 'end_time'] is not None: # noqa: E501 query_params.append( ('end_time', local_var_params['end_time'])) # noqa: E501 if 'page' in local_var_params and local_var_params[ 'page'] is not None: # noqa: E501 query_params.append( ('page', local_var_params['page'])) # noqa: E501 if 'per_page' in local_var_params and local_var_params[ 'per_page'] is not None: # noqa: E501 query_params.append( ('per_page', local_var_params['per_page'])) # noqa: E501 if 'with_count' in local_var_params and local_var_params[ 'with_count'] is not None: # noqa: E501 query_params.append( ('with_count', local_var_params['with_count'])) # noqa: E501 if 'filter' in local_var_params and local_var_params[ 'filter'] is not None: # noqa: E501 query_params.append( ('filter', local_var_params['filter'])) # noqa: E501 if 'sort' in local_var_params and local_var_params[ 'sort'] is not None: # noqa: E501 query_params.append( ('sort', local_var_params['sort'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2PasswordBearer'] # noqa: E501 return self.api_client.call_api( '/logs/workflows/{workflow_id}/actions/{action_id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ActionLogsResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def get_self_account_stats_with_http_info(self, start_time, end_time, **kwargs): # noqa: E501 """Show my account report # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_self_account_stats_with_http_info(start_time, end_time, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int start_time: (required) :param int end_time: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(AccountStatsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['start_time', 'end_time'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_self_account_stats" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'start_time' is set if self.api_client.client_side_validation and ( 'start_time' not in local_var_params or # noqa: E501 local_var_params['start_time'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `start_time` when calling `get_self_account_stats`" ) # noqa: E501 # verify the required parameter 'end_time' is set if self.api_client.client_side_validation and ( 'end_time' not in local_var_params or # noqa: E501 local_var_params['end_time'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `end_time` when calling `get_self_account_stats`" ) # noqa: E501 if self.api_client.client_side_validation and 'start_time' in local_var_params and local_var_params[ 'start_time'] > 2147483647: # noqa: E501 raise ApiValueError( "Invalid value for parameter `start_time` when calling `get_self_account_stats`, must be a value less than or equal to `2147483647`" ) # noqa: E501 if self.api_client.client_side_validation and 'start_time' in local_var_params and local_var_params[ 'start_time'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `start_time` when calling `get_self_account_stats`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'end_time' in local_var_params and local_var_params[ 'end_time'] > 2147483647: # noqa: E501 raise ApiValueError( "Invalid value for parameter `end_time` when calling `get_self_account_stats`, must be a value less than or equal to `2147483647`" ) # noqa: E501 if self.api_client.client_side_validation and 'end_time' in local_var_params and local_var_params[ 'end_time'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `end_time` when calling `get_self_account_stats`, must be a value greater than or equal to `1`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'start_time' in local_var_params and local_var_params[ 'start_time'] is not None: # noqa: E501 query_params.append( ('start_time', local_var_params['start_time'])) # noqa: E501 if 'end_time' in local_var_params and local_var_params[ 'end_time'] is not None: # noqa: E501 query_params.append( ('end_time', local_var_params['end_time'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2PasswordBearer'] # noqa: E501 return self.api_client.call_api( '/reports/accounts/self', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='AccountStatsResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def list_forms_with_http_info(self, **kwargs): # noqa: E501 """Show all forms # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_forms_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int account_id: :param int page: :param int per_page: :param bool with_count: :param str sort: Sort term and direction, using syntax `[-|+]term`. Valid terms: - `name` - `language` - `created_on` - `last_updated_on` - `list_id` - `status` :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(FormsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['account_id', 'page', 'per_page', 'with_count', 'sort'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_forms" % key) local_var_params[key] = val del local_var_params['kwargs'] if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params[ 'page'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `page` when calling `list_forms`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'per_page' in local_var_params and local_var_params[ 'per_page'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `per_page` when calling `list_forms`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'sort' in local_var_params and not re.search( r'[-|+]?[a-zA-Z_]+', local_var_params['sort']): # noqa: E501 raise ApiValueError( "Invalid value for parameter `sort` when calling `list_forms`, must conform to the pattern `/[-|+]?[a-zA-Z_]+/`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'account_id' in local_var_params and local_var_params[ 'account_id'] is not None: # noqa: E501 query_params.append( ('account_id', local_var_params['account_id'])) # noqa: E501 if 'page' in local_var_params and local_var_params[ 'page'] is not None: # noqa: E501 query_params.append( ('page', local_var_params['page'])) # noqa: E501 if 'per_page' in local_var_params and local_var_params[ 'per_page'] is not None: # noqa: E501 query_params.append( ('per_page', local_var_params['per_page'])) # noqa: E501 if 'with_count' in local_var_params and local_var_params[ 'with_count'] is not None: # noqa: E501 query_params.append( ('with_count', local_var_params['with_count'])) # noqa: E501 if 'sort' in local_var_params and local_var_params[ 'sort'] is not None: # noqa: E501 query_params.append( ('sort', local_var_params['sort'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2PasswordBearer'] # noqa: E501 return self.api_client.call_api( '/forms', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='FormsResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def patch_domains_with_http_info(self, patch_domains, **kwargs): # noqa: E501 """Change domains # noqa: E501 Change the Tracking and Bounce domains. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_domains_with_http_info(patch_domains, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param PatchDomains patch_domains: (required) :param int account_id: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(PatchDomainsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['patch_domains', 'account_id'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method patch_domains" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'patch_domains' is set if self.api_client.client_side_validation and ( 'patch_domains' not in local_var_params or # noqa: E501 local_var_params['patch_domains'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `patch_domains` when calling `patch_domains`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'account_id' in local_var_params and local_var_params[ 'account_id'] is not None: # noqa: E501 query_params.append( ('account_id', local_var_params['account_id'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None if 'patch_domains' in local_var_params: body_params = local_var_params['patch_domains'] # 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 = ['OAuth2PasswordBearer'] # noqa: E501 return self.api_client.call_api( '/brands/default/domains/default', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PatchDomainsResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def create_token_with_http_info(self, username, password, **kwargs): # noqa: E501 """Create a token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_token_with_http_info(username, password, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str username: (required) :param str password: (required) :param PasswordGrantType grant_type: :param int account_id: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(TokenResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'username', 'password', 'grant_type', 'account_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_token" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `create_token`") # noqa: E501 # verify the required parameter 'password' is set if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501 local_var_params['password'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `password` when calling `create_token`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} if 'grant_type' in local_var_params: form_params.append(('grant_type', local_var_params['grant_type'])) # noqa: E501 if 'username' in local_var_params: form_params.append(('username', local_var_params['username'])) # noqa: E501 if 'password' in local_var_params: form_params.append(('password', local_var_params['password'])) # noqa: E501 if 'account_id' in local_var_params: form_params.append(('account_id', local_var_params['account_id'])) # noqa: E501 body_params = None # 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/x-www-form-urlencoded']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/token', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TokenResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)