def update_params_for_auth(self, headers, querys, auth_settings): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. """ if not auth_settings: return for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': headers[auth_setting['key']] = auth_setting['value'] elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: raise ApiValueError( 'Authentication token must be in `query` or `header`')
def create_volume_configuration_with_http_info(self, body, **kwargs): # noqa: E501 """Create a volume configuration in GDS. # noqa: E501 Create a volume configuration in GDS. This contains the object store details that will be used to create volumes. # 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_volume_configuration_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param CreateVolumeConfigurationRequest body: (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(VolumeConfigurationResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['body'] 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_volume_configuration" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set if self.api_client.client_side_validation and ( 'body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `body` when calling `create_volume_configuration`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_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 = ['Basic', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/volumeconfigurations', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='VolumeConfigurationResponse', # 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_volume_configurations_with_http_info(self, **kwargs): # noqa: E501 """Get a list of volumes # 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_volume_configurations_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str online_status: Optional field that specifies the Online Status for Volume configurations included in the list. If provided, the value must be Initializing, Ok, or Error. :param int page_size: START_DESC END_DESC :param str page_token: START_DESC END_DESC :param str include: Optionally include additional fields in the response. Multiple fields can be included by comma-separation. Possible values: TotalItemCount, InheritedAcl :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(VolumeConfigurationListResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['online_status', 'page_size', 'page_token', 'include'] 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_volume_configurations" % key) local_var_params[key] = val del local_var_params['kwargs'] if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params[ 'page_size'] > 1000: # noqa: E501 raise ApiValueError( "Invalid value for parameter `page_size` when calling `list_volume_configurations`, must be a value less than or equal to `1000`" ) # noqa: E501 if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params[ 'page_size'] < 0: # noqa: E501 raise ApiValueError( "Invalid value for parameter `page_size` when calling `list_volume_configurations`, must be a value greater than or equal to `0`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'online_status' in local_var_params and local_var_params[ 'online_status'] is not None: # noqa: E501 query_params.append( ('onlineStatus', local_var_params['online_status'])) # noqa: E501 if 'page_size' in local_var_params and local_var_params[ 'page_size'] is not None: # noqa: E501 query_params.append( ('pageSize', local_var_params['page_size'])) # noqa: E501 if 'page_token' in local_var_params and local_var_params[ 'page_token'] is not None: # noqa: E501 query_params.append( ('pageToken', local_var_params['page_token'])) # noqa: E501 if 'include' in local_var_params and local_var_params[ 'include'] is not None: # noqa: E501 query_params.append( ('include', local_var_params['include'])) # 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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/volumeconfigurations', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='VolumeConfigurationListResponse', # 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 abort_workflow_run_with_http_info(self, run_id, **kwargs): # noqa: E501 """Abort a workflow run # noqa: E501 Aborts the workflow run with a given ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.abort_workflow_run_with_http_info(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: ID of the workflow run (required) :param list[str] include: Comma-separated list of properties to include in the response :param AbortWorkflowRunRequest body: :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(WorkflowRun, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['run_id', 'include', 'body'] 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 abort_workflow_run" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'run_id' is set if self.api_client.client_side_validation and ( 'run_id' not in local_var_params or # noqa: E501 local_var_params['run_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `run_id` when calling `abort_workflow_run`" ) # noqa: E501 collection_formats = {} path_params = {} if 'run_id' in local_var_params: path_params['runId'] = local_var_params['run_id'] # noqa: E501 query_params = [] if 'include' in local_var_params and local_var_params[ 'include'] is not None: # noqa: E501 query_params.append( ('include', local_var_params['include'])) # noqa: E501 collection_formats['include'] = 'csv' # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_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-patch+json', 'application/json', 'text/json', 'application/*+json' ]) # noqa: E501 # Authentication setting auth_settings = ['Basic', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/workflows/runs/{runId}:abort', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='WorkflowRun', # 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_workflow_run_history_with_http_info(self, run_id, **kwargs): # noqa: E501 """Get a list of workflow run history events # noqa: E501 Gets a list of history events for a workflow run with a given ID. # 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_workflow_run_history_with_http_info(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: ID of the workflow run (required) :param str sort: :param list[str] include: Comma-separated list of properties to include in the response :param int page_size: Number of items to include in a page. Value must be an integer between 1 and 1000. Only one of pageSize or pageToken can be specified. :param str page_token: Page offset descriptor. Valid page tokens are included in the response. Only one of pageSize or pageToken can be specified. :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(WorkflowRunHistoryEventList, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['run_id', 'sort', 'include', 'page_size', 'page_token'] 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_workflow_run_history" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'run_id' is set if self.api_client.client_side_validation and ( 'run_id' not in local_var_params or # noqa: E501 local_var_params['run_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `run_id` when calling `list_workflow_run_history`" ) # noqa: E501 collection_formats = {} path_params = {} if 'run_id' in local_var_params: path_params['runId'] = local_var_params['run_id'] # noqa: E501 query_params = [] 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 if 'include' in local_var_params and local_var_params[ 'include'] is not None: # noqa: E501 query_params.append( ('include', local_var_params['include'])) # noqa: E501 collection_formats['include'] = 'csv' # noqa: E501 if 'page_size' in local_var_params and local_var_params[ 'page_size'] is not None: # noqa: E501 query_params.append( ('pageSize', local_var_params['page_size'])) # noqa: E501 if 'page_token' in local_var_params and local_var_params[ 'page_token'] is not None: # noqa: E501 query_params.append( ('pageToken', local_var_params['page_token'])) # 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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/workflows/runs/{runId}/history', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='WorkflowRunHistoryEventList', # 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_usage_with_http_info(self, **kwargs): # noqa: E501 """Get current tenant's usage detail by period. Default returns current period usage data. # noqa: E501 This endpoint provides the ability for the user to get the aggregated usage data # 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_usage_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int periods: :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(UsageResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['periods'] 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_usage" % key) local_var_params[key] = val del local_var_params['kwargs'] if self.api_client.client_side_validation and 'periods' in local_var_params and local_var_params[ 'periods'] > 6: # noqa: E501 raise ApiValueError( "Invalid value for parameter `periods` when calling `get_usage`, must be a value less than or equal to `6`" ) # noqa: E501 if self.api_client.client_side_validation and 'periods' in local_var_params and local_var_params[ 'periods'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `periods` when calling `get_usage`, must be a value greater than or equal to `1`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'periods' in local_var_params and local_var_params[ 'periods'] is not None: # noqa: E501 query_params.append( ('periods', local_var_params['periods'])) # 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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/usages', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='UsageResponse', # 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 disable_subscription_with_http_info(self, subscription_id, **kwargs): # noqa: E501 """Given a subscription id, disables the specified subscription. # noqa: E501 Given a subscription id, disables that subscription with the current JWT token’s tenant Id. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.disable_subscription_with_http_info(subscription_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str subscription_id: Id of the subscription to be disabled (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(Subscription, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['subscription_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 disable_subscription" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'subscription_id' is set if self.api_client.client_side_validation and ( 'subscription_id' not in local_var_params or # noqa: E501 local_var_params['subscription_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `subscription_id` when calling `disable_subscription`" ) # noqa: E501 if self.api_client.client_side_validation and ( 'subscription_id' in local_var_params and # noqa: E501 len(local_var_params['subscription_id']) > 255): # noqa: E501 raise ApiValueError( "Invalid value for parameter `subscription_id` when calling `disable_subscription`, length must be less than or equal to `255`" ) # noqa: E501 collection_formats = {} path_params = {} if 'subscription_id' in local_var_params: path_params['subscriptionId'] = local_var_params[ 'subscription_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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/subscriptions/{subscriptionId}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Subscription', # 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_task_versions_with_http_info(self, task_id, **kwargs): # noqa: E501 """Get a list of versions # noqa: E501 Gets a list of task versions within the given task accessible by the current tenant ID. # 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_task_versions_with_http_info(task_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str task_id: (required) :param str sort: Sort: Optional parameter to set the sort of the returned list. Valid fields include: name, version, timeCreated, timeModified. The sort can be specified as asc or desc. (Default: asc.) :param str versions: :param str ids: :param str acls: :param int page_size: Optional parameter to define the page size returned. Valid inputs range from 1-1000. :param str page_token: pageToken: Optional parameter for navigation after initial listing. Valid values include firstPageToken, nextPageToken, and previousPageToken (provided in the list response) :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(TaskVersionSummaryPagedItems, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'task_id', 'sort', 'versions', 'ids', 'acls', 'page_size', 'page_token' ] 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_task_versions" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'task_id' is set if self.api_client.client_side_validation and ( 'task_id' not in local_var_params or # noqa: E501 local_var_params['task_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `task_id` when calling `list_task_versions`" ) # noqa: E501 collection_formats = {} path_params = {} if 'task_id' in local_var_params: path_params['taskId'] = local_var_params['task_id'] # noqa: E501 query_params = [] 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 if 'versions' in local_var_params and local_var_params[ 'versions'] is not None: # noqa: E501 query_params.append( ('versions', local_var_params['versions'])) # noqa: E501 if 'ids' in local_var_params and local_var_params[ 'ids'] is not None: # noqa: E501 query_params.append(('ids', local_var_params['ids'])) # noqa: E501 if 'acls' in local_var_params and local_var_params[ 'acls'] is not None: # noqa: E501 query_params.append( ('acls', local_var_params['acls'])) # noqa: E501 if 'page_size' in local_var_params and local_var_params[ 'page_size'] is not None: # noqa: E501 query_params.append( ('pageSize', local_var_params['page_size'])) # noqa: E501 if 'page_token' in local_var_params and local_var_params[ 'page_token'] is not None: # noqa: E501 query_params.append( ('pageToken', local_var_params['page_token'])) # 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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/tasks/{taskId}/versions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TaskVersionSummaryPagedItems', # 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_library_prep_kit_with_http_info(self, library_prep_kit_id, **kwargs): # noqa: E501 """Get library prep kit details. # noqa: E501 For a given library prep kit ID, return information about that library prep kit. # 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_library_prep_kit_with_http_info(library_prep_kit_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str library_prep_kit_id: ID of the library prep kit (required) :param list[str] include: Include flags to specify what is included in the response :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(LibraryPrepKit, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'library_prep_kit_id', 'include' ] 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_library_prep_kit" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'library_prep_kit_id' is set if self.api_client.client_side_validation and ('library_prep_kit_id' not in local_var_params or # noqa: E501 local_var_params['library_prep_kit_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `library_prep_kit_id` when calling `get_library_prep_kit`") # noqa: E501 collection_formats = {} path_params = {} if 'library_prep_kit_id' in local_var_params: path_params['libraryPrepKitId'] = local_var_params['library_prep_kit_id'] # noqa: E501 query_params = [] if 'include' in local_var_params and local_var_params['include'] is not None: # noqa: E501 query_params.append(('include', local_var_params['include'])) # noqa: E501 collection_formats['include'] = 'csv' # 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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/sequencing/libraryPrepKits/{libraryPrepKitId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='LibraryPrepKit', # 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 request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): """Makes the HTTP request using RESTClient.""" if method == "GET": return self.rest_client.GET(url, query_params=query_params, _preload_content=_preload_content, _request_timeout=_request_timeout, headers=headers) elif method == "HEAD": return self.rest_client.HEAD(url, query_params=query_params, _preload_content=_preload_content, _request_timeout=_request_timeout, headers=headers) elif method == "OPTIONS": return self.rest_client.OPTIONS(url, query_params=query_params, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout) elif method == "POST": return self.rest_client.POST(url, query_params=query_params, headers=headers, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) elif method == "PUT": return self.rest_client.PUT(url, query_params=query_params, headers=headers, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) elif method == "PATCH": return self.rest_client.PATCH(url, query_params=query_params, headers=headers, post_params=post_params, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) elif method == "DELETE": return self.rest_client.DELETE(url, query_params=query_params, headers=headers, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) else: raise ApiValueError("http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`.")
def request(self, method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None): """Perform requests. :param method: http request method :param url: http request url :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` :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. """ method = method.upper() assert method in [ 'GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS' ] if post_params and body: raise ApiValueError( "body parameter cannot be used with post_params parameter.") post_params = post_params or {} headers = headers or {} timeout = None if _request_timeout: if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) if 'Content-Type' not in headers: headers['Content-Type'] = 'application/json' try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: if query_params: url += '?' + urlencode(query_params) if re.search('json', headers['Content-Type'], re.IGNORECASE): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( method, url, body=request_body, preload_content=_preload_content, timeout=timeout, headers=headers) elif headers[ 'Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( method, url, fields=post_params, encode_multipart=False, preload_content=_preload_content, timeout=timeout, headers=headers) elif headers['Content-Type'] == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] r = self.pool_manager.request( method, url, fields=post_params, encode_multipart=True, preload_content=_preload_content, timeout=timeout, headers=headers) # Pass a `string` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( method, url, body=request_body, preload_content=_preload_content, timeout=timeout, headers=headers) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided arguments. Please check that your arguments match declared content type.""" raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: r = self.pool_manager.request(method, url, fields=query_params, preload_content=_preload_content, timeout=timeout, headers=headers) except urllib3.exceptions.SSLError as e: msg = "{0}\n{1}".format(type(e).__name__, str(e)) raise ApiException(status=0, reason=msg) if _preload_content: r = RESTResponse(r) # In the python 3, the response.data is bytes. # we need to decode it to string. if six.PY3: r.data = r.data.decode('utf8') # log response body logger.debug("response body: %s", r.data) if not 200 <= r.status <= 299: raise ApiException(http_resp=r) return r
def replace_planned_run_with_http_info(self, run_id, **kwargs): # noqa: E501 """Replace planned run configuration, contents, and analysis configurations. # noqa: E501 For a given sequencing run ID, replace the existing planned run with user input. This may include run configuration, run contents, and analysis configurations. Only applicable to runs in planning stage. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.replace_planned_run_with_http_info(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: (required) :param ReplacePlannedRunRequest body: :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(SequencingRun, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['run_id', 'body'] 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 replace_planned_run" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'run_id' is set if self.api_client.client_side_validation and ( 'run_id' not in local_var_params or # noqa: E501 local_var_params['run_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `run_id` when calling `replace_planned_run`" ) # noqa: E501 collection_formats = {} path_params = {} if 'run_id' in local_var_params: path_params['runId'] = local_var_params['run_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_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 = ['Basic', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/sequencing/runs/{runId}/plan', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='SequencingRun', # 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_subscriptions_with_http_info(self, **kwargs): # noqa: E501 """Get a list of subscriptions. # noqa: E501 Get a list of subscriptions accessible by the current JWT token’s tenant Id. # 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_subscriptions_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str event_type: Optional event type for filtering returned subscriptions :param int page_size: Optional parameter to define the page size returned. Valid inputs range from 1-1000. :param str page_token: Utilized for navigation after initial listing. Valid values include those of firstPageToken, nextPageToken, and previousPageToken in the list response. When there are no more pages, the nextPageToken will be null. :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(SubscriptionList, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['event_type', 'page_size', 'page_token'] 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_subscriptions" % key) local_var_params[key] = val del local_var_params['kwargs'] if self.api_client.client_side_validation and ( 'event_type' in local_var_params and # noqa: E501 len(local_var_params['event_type']) > 255): # noqa: E501 raise ApiValueError( "Invalid value for parameter `event_type` when calling `list_subscriptions`, length must be less than or equal to `255`" ) # noqa: E501 if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params[ 'page_size'] > 1000: # noqa: E501 raise ApiValueError( "Invalid value for parameter `page_size` when calling `list_subscriptions`, must be a value less than or equal to `1000`" ) # noqa: E501 if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params[ 'page_size'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `page_size` when calling `list_subscriptions`, must be a value greater than or equal to `1`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'event_type' in local_var_params and local_var_params[ 'event_type'] is not None: # noqa: E501 query_params.append( ('eventType', local_var_params['event_type'])) # noqa: E501 if 'page_size' in local_var_params and local_var_params[ 'page_size'] is not None: # noqa: E501 query_params.append( ('pageSize', local_var_params['page_size'])) # noqa: E501 if 'page_token' in local_var_params and local_var_params[ 'page_token'] is not None: # noqa: E501 query_params.append( ('pageToken', local_var_params['page_token'])) # 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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/subscriptions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='SubscriptionList', # 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_account_with_http_info(self, account_id, **kwargs): # noqa: E501 """Get requested account id info require authorization Bearer token # noqa: E501 Get requested account id info # 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_account_with_http_info(account_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str account_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(AccountResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['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 get_account" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'account_id' is set if self.api_client.client_side_validation and ( 'account_id' not in local_var_params or # noqa: E501 local_var_params['account_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `account_id` when calling `get_account`" ) # noqa: E501 collection_formats = {} path_params = {} if 'account_id' in local_var_params: path_params['accountId'] = local_var_params[ 'account_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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/accounts/{accountId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='AccountResponse', # 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_volume_with_http_info(self, volume_id, **kwargs): # noqa: E501 """Deletes a volume by Id # 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_volume_with_http_info(volume_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str volume_id: Unique identifier for the Volume to be deleted. (required) :param bool purge_object_store_data: Optional and for BYOB only. If true, the volume's data in object storage will be erased. This field is ignored for non-BYOB volumes where the object store data is always removed upon deleting the volume. :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(VolumeResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'volume_id', 'purge_object_store_data' ] 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_volume" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'volume_id' is set if self.api_client.client_side_validation and ('volume_id' not in local_var_params or # noqa: E501 local_var_params['volume_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `volume_id` when calling `delete_volume`") # noqa: E501 collection_formats = {} path_params = {} if 'volume_id' in local_var_params: path_params['volumeId'] = local_var_params['volume_id'] # noqa: E501 query_params = [] if 'purge_object_store_data' in local_var_params and local_var_params['purge_object_store_data'] is not None: # noqa: E501 query_params.append(('purgeObjectStoreData', local_var_params['purge_object_store_data'])) # 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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/volumes/{volumeId}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='VolumeResponse', # 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 update_library_with_http_info(self, library_id, **kwargs): # noqa: E501 """Update library. # noqa: E501 For a given library ID, update the library. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_library_with_http_info(library_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str library_id: The id of the requested library. (required) :param UpdateLibraryRequest body: The update request for the library :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(Library, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'library_id', 'body' ] 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 update_library" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'library_id' is set if self.api_client.client_side_validation and ('library_id' not in local_var_params or # noqa: E501 local_var_params['library_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `library_id` when calling `update_library`") # noqa: E501 collection_formats = {} path_params = {} if 'library_id' in local_var_params: path_params['libraryId'] = local_var_params['library_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_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 = ['Basic', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/sequencing/libraries/{libraryId}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Library', # 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_volume_with_http_info(self, volume_id, **kwargs): # noqa: E501 """Get information for the specified volume ID or volume name # 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_volume_with_http_info(volume_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str volume_id: Unique identifier for the volume to retrieve information for. (required) :param str tenant_id: Optional parameter to see shared data in another tenant :param str metadata_include: Optional parameter to specify comma separated patterns to include metadata by their field names. :param str metadata_exclude: Optional parameter to specify comma separated patterns to exclude metadata by their field names. :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(VolumeResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'volume_id', 'tenant_id', 'metadata_include', 'metadata_exclude' ] 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_volume" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'volume_id' is set if self.api_client.client_side_validation and ('volume_id' not in local_var_params or # noqa: E501 local_var_params['volume_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `volume_id` when calling `get_volume`") # noqa: E501 collection_formats = {} path_params = {} if 'volume_id' in local_var_params: path_params['volumeId'] = local_var_params['volume_id'] # noqa: E501 query_params = [] if 'tenant_id' in local_var_params and local_var_params['tenant_id'] is not None: # noqa: E501 query_params.append(('tenantId', local_var_params['tenant_id'])) # noqa: E501 if 'metadata_include' in local_var_params and local_var_params['metadata_include'] is not None: # noqa: E501 query_params.append(('metadata.include', local_var_params['metadata_include'])) # noqa: E501 if 'metadata_exclude' in local_var_params and local_var_params['metadata_exclude'] is not None: # noqa: E501 query_params.append(('metadata.exclude', local_var_params['metadata_exclude'])) # 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', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/volumes/{volumeId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='VolumeResponse', # 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_task_version_with_http_info(self, task_id, **kwargs): # noqa: E501 """Create a task version # noqa: E501 Creates a new task version within an existing task. Returns the ID associated with the new task version. Substitutions can be defined in the following format: \"{{string}}\", and specified at launch time. # 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_task_version_with_http_info(task_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str task_id: (required) :param CreateTaskVersionRequest body: :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(TaskVersion, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['task_id', 'body'] 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_task_version" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'task_id' is set if self.api_client.client_side_validation and ( 'task_id' not in local_var_params or # noqa: E501 local_var_params['task_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `task_id` when calling `create_task_version`" ) # noqa: E501 collection_formats = {} path_params = {} if 'task_id' in local_var_params: path_params['taskId'] = local_var_params['task_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_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-patch+json', 'application/json', 'text/json', 'application/*+json' ]) # noqa: E501 # Authentication setting auth_settings = ['Basic', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/tasks/{taskId}/versions', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TaskVersion', # 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 update_workflow_version_with_http_info(self, workflow_id, version_name, **kwargs): # noqa: E501 """Update an existing workflow version # noqa: E501 Updates an existing workflow version. Note: The Version, Definition, and Status cannot be changed simultaneously. Only one of these can be changed per API call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_workflow_version_with_http_info(workflow_id, version_name, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str workflow_id: ID of the workflow (required) :param str version_name: Name of the workflow version (required) :param UpdateWorkflowVersionRequest body: :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(WorkflowVersion, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'workflow_id', 'version_name', 'body' ] 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 update_workflow_version" % 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 `update_workflow_version`") # noqa: E501 # verify the required parameter 'version_name' is set if self.api_client.client_side_validation and ('version_name' not in local_var_params or # noqa: E501 local_var_params['version_name'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `version_name` when calling `update_workflow_version`") # noqa: E501 collection_formats = {} path_params = {} if 'workflow_id' in local_var_params: path_params['workflowId'] = local_var_params['workflow_id'] # noqa: E501 if 'version_name' in local_var_params: path_params['versionName'] = local_var_params['version_name'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_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-patch+json', 'application/json', 'text/json', 'application/*+json']) # noqa: E501 # Authentication setting auth_settings = ['Basic', 'Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/workflows/{workflowId}/versions/{versionName}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='WorkflowVersion', # 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)