def get_pa_columns_with_http_info(self, **kwargs): # noqa: E501 """Get PA columns # noqa: E501 This endpoint lists all the PA columns that can be applied to a calculation. # 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_pa_columns_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str name: :param str category: :param str directory: :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(dict(str, ColumnSummary), status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['name', 'category', 'directory'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_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_pa_columns" % key) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'name' in local_var_params and local_var_params[ 'name'] is not None: # noqa: E501 query_params.append( ('name', local_var_params['name'])) # noqa: E501 if 'category' in local_var_params and local_var_params[ 'category'] is not None: # noqa: E501 query_params.append( ('category', local_var_params['category'])) # noqa: E501 if 'directory' in local_var_params and local_var_params[ 'directory'] is not None: # noqa: E501 query_params.append( ('directory', local_var_params['directory'])) # 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 = ['Basic'] # noqa: E501 return self.api_client.call_api( '/analytics/lookups/v2/engines/pa/columns', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='dict(str, ColumnSummary)', # 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_pa_column_by_id_with_http_info(self, id, **kwargs): # noqa: E501 """Get PA column settings # noqa: E501 This endpoint returns the default settings of a PA column. # 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_pa_column_by_id_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str id: Unique identifier for a column (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(Column, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_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_pa_column_by_id" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and ( 'id' not in local_var_params or # noqa: E501 local_var_params['id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `id` when calling `get_pa_column_by_id`" ) # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['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 = ['Basic'] # noqa: E501 return self.api_client.call_api( '/analytics/lookups/v2/engines/pa/columns/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Column', # 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 convert_pa_dates_to_absolute_format_with_http_info( self, enddate, componentid, account, **kwargs): # noqa: E501 """Convert PA dates to absolute format # noqa: E501 This endpoint converts the given start and end dates to yyyymmdd format for a PA calculation. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.convert_pa_dates_to_absolute_format_with_http_info(enddate, componentid, account, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str enddate: End Date (required) :param str componentid: Component Id (required) :param str account: Account (required) :param str startdate: Start Date :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(DateParametersSummary, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['enddate', 'componentid', 'account', 'startdate'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_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 convert_pa_dates_to_absolute_format" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'enddate' is set if self.api_client.client_side_validation and ( 'enddate' not in local_var_params or # noqa: E501 local_var_params['enddate'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `enddate` when calling `convert_pa_dates_to_absolute_format`" ) # noqa: E501 # verify the required parameter 'componentid' is set if self.api_client.client_side_validation and ( 'componentid' not in local_var_params or # noqa: E501 local_var_params['componentid'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `componentid` when calling `convert_pa_dates_to_absolute_format`" ) # noqa: E501 # verify the required parameter 'account' is set if self.api_client.client_side_validation and ( 'account' not in local_var_params or # noqa: E501 local_var_params['account'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `account` when calling `convert_pa_dates_to_absolute_format`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'startdate' in local_var_params and local_var_params[ 'startdate'] is not None: # noqa: E501 query_params.append( ('startdate', local_var_params['startdate'])) # noqa: E501 if 'enddate' in local_var_params and local_var_params[ 'enddate'] is not None: # noqa: E501 query_params.append( ('enddate', local_var_params['enddate'])) # noqa: E501 if 'componentid' in local_var_params and local_var_params[ 'componentid'] is not None: # noqa: E501 query_params.append( ('componentid', local_var_params['componentid'])) # noqa: E501 if 'account' in local_var_params and local_var_params[ 'account'] is not None: # noqa: E501 query_params.append( ('account', local_var_params['account'])) # 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 = ['Basic'] # noqa: E501 return self.api_client.call_api( '/analytics/lookups/v2/engines/pa/dates', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='DateParametersSummary', # 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 cancel_calculation_by_id_with_http_info(self, id, **kwargs): # noqa: E501 """Cancel calculation by id # noqa: E501 This is the endpoint to cancel a previously submitted calculation request. Instead of doing a GET on the getCalculationById URL, cancel the calculation by doing a DELETE. All individual calculation units within the calculation will be canceled if they have not already finished. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.cancel_calculation_by_id_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str id: From url, provided from the location header in the Run Multiple Calculations endpoint. (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: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_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 cancel_calculation_by_id" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and ( 'id' not in local_var_params or # noqa: E501 local_var_params['id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `id` when calling `cancel_calculation_by_id`" ) # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['Basic'] # noqa: E501 return self.api_client.call_api( '/analytics/engines/v2/calculations/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # 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 run_calculation_with_http_info(self, **kwargs): # noqa: E501 """Run calculation # noqa: E501 This endpoint creates a new calculation and runs the set of calculation units specified in the POST body. This must be used first before get status or cancelling endpoints with a calculation id. A successful response will contain the URL to check the status of the calculation request. Remarks: ⢠Maximum 25 points allowed per calculation and maximum 500 points allowed across all simultaneous calculations. (Refer API documentation for more information) ⢠Any settings in POST body will act as a one-time override over the settings saved in the PA/SPAR/Vault template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.run_calculation_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param Calculation calculation: :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: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['calculation'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_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 run_calculation" % key) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'calculation' in local_var_params: body_params = local_var_params['calculation'] # 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 = ['Basic'] # noqa: E501 return self.api_client.call_api( '/analytics/engines/v2/calculations', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # 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 call_with_http_info(self, **kwargs): try: index = self.api_client.configuration.server_operation_index.get( self.settings['operation_id'], self.api_client.configuration.server_index ) if kwargs['_host_index'] is None else kwargs['_host_index'] server_variables = self.api_client.configuration.server_operation_variables.get( self.settings['operation_id'], self.api_client.configuration.server_variables) _host = self.api_client.configuration.get_host_from_settings( index, variables=server_variables, servers=self.settings['servers']) except IndexError: if self.settings['servers']: raise ApiValueError( "Invalid host index. Must be 0 <= index < %s" % len(self.settings['servers'])) _host = None for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError("Got an unexpected parameter '%s'" " to method `%s`" % (key, self.settings['operation_id'])) # only throw this nullable ApiValueError if _check_input_type # is False, if _check_input_type==True we catch this case # in self.__validate_inputs if (key not in self.params_map['nullable'] and value is None and kwargs['_check_input_type'] is False): raise ApiValueError( "Value may not be None for non-nullable parameter `%s`" " when calling `%s`" % (key, self.settings['operation_id'])) for key in self.params_map['required']: if key not in kwargs.keys(): raise ApiValueError( "Missing the required parameter `%s` when calling " "`%s`" % (key, self.settings['operation_id'])) self.__validate_inputs(kwargs) params = self.__gather_params(kwargs) accept_headers_list = self.headers_map['accept'] if accept_headers_list: params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) content_type_headers_list = self.headers_map['content_type'] if content_type_headers_list: header_list = self.api_client.select_header_content_type( content_type_headers_list) params['header']['Content-Type'] = header_list return self.api_client.call_api_with_return_dict( self.settings['endpoint_path'], self.settings['http_method'], params['path'], params['query'], params['header'], body=params['body'], post_params=params['form'], files=params['file'], response_type_dict=self.settings['response_type'], auth_settings=self.settings['auth'], async_req=kwargs['async_req'], _check_type=kwargs['_check_return_type'], _return_http_data_only=kwargs['_return_http_data_only'], _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, collection_formats=params['collection_format'])
def get_by_url_with_http_info(self, url, **kwargs): # noqa: E501 """Get by Url # noqa: E501 This method fetches data from any GET endpoint. # 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_by_url_with_http_info(url, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param url str: url of the GET endpoint (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(object, response_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['url'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_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" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'url' is set if self.api_client.client_side_validation and ( 'url' not in local_var_params or # noqa: E501 local_var_params['url'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `url` when calling `getByUrl`" ) # noqa: E501 collection_formats = {} path = urlparse(local_var_params['url']).path response_type = object path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # Authentication setting auth_settings = ['Basic'] return self.api_client.call_api( path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=response_type, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)