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 get_model_with_http_info(self, uuid, **kwargs): # noqa: E501 """Get a model by UUID # noqa: E501 Fetch a model by UUID # 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_model_with_http_info(uuid, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str uuid: Model UUID (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(Model, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['uuid'] 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_model" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'uuid' is set if self.api_client.client_side_validation and ( 'uuid' not in local_var_params or # noqa: E501 local_var_params['uuid'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `uuid` when calling `get_model`" ) # noqa: E501 collection_formats = {} path_params = {} if 'uuid' in local_var_params: path_params['uuid'] = local_var_params['uuid'] # 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 = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( '/models/{uuid}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Model', # 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_models_with_http_info(self, limit, offset, **kwargs): # noqa: E501 """Fetch models # noqa: E501 Fetch Models, filtered by the respective query parameters (most recent first) # 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_models_with_http_info(limit, offset, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int limit: Max records to return (required) :param int offset: Number of items to skip (required) :param str filename: Filename of the model :param list[str] sort: Field(s) to sort by. Ascending order by default, use `sort=field,desc` to specify descending order. Sortable fields are: `filename` :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(ModelsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['limit', 'offset', 'filename', '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_models" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'limit' is set if self.api_client.client_side_validation and ( 'limit' not in local_var_params or # noqa: E501 local_var_params['limit'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `limit` when calling `get_models`" ) # noqa: E501 # verify the required parameter 'offset' is set if self.api_client.client_side_validation and ( 'offset' not in local_var_params or # noqa: E501 local_var_params['offset'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `offset` when calling `get_models`" ) # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[ 'limit'] > 1000: # noqa: E501 raise ApiValueError( "Invalid value for parameter `limit` when calling `get_models`, must be a value less than or equal to `1000`" ) # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[ 'limit'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `limit` when calling `get_models`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params[ 'offset'] < 0: # noqa: E501 raise ApiValueError( "Invalid value for parameter `offset` when calling `get_models`, must be a value greater than or equal to `0`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'filename' in local_var_params and local_var_params[ 'filename'] is not None: # noqa: E501 query_params.append( ('filename', local_var_params['filename'])) # noqa: E501 if 'limit' in local_var_params and local_var_params[ 'limit'] is not None: # noqa: E501 query_params.append( ('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params[ 'offset'] is not None: # noqa: E501 query_params.append( ('offset', local_var_params['offset'])) # 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 collection_formats['sort'] = 'multi' # 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 = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( '/models', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ModelsResponse', # 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, 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) # log response body logger.debug("response body: %s", r.data) if not 200 <= r.status <= 299: raise ApiException(http_resp=r) return r
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 get_parts_with_http_info(self, limit, **kwargs): # noqa: E501 """Fetch parts # noqa: E501 Gets a list of `Part` entities (most recent first) # 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_parts_with_http_info(limit, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int limit: Max records to return (required) :param str cursor: Cursor for paginating through data (e.g. dXNlcjpXMDdRQ1JQQTQ=d) :param list[str] uuid: An array of UUIDs :param list[str] application_uuid: An array of Application UUIDs :param datetime updated_before: Updated before timestamp (exclusive) :param datetime updated_after: Updated at or after timestamp (inclusive) :param list[str] model_uuid: A model_uuid or array of model_uuids :param list[str] sort: Field(s) to sort by. Ascending order by default, use `sort=field,desc` to specify descending order. Sortable fields are: `uuid`, `updated_at`, `part_number`, `model_uuid` :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(PartsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'limit', 'cursor', 'uuid', 'application_uuid', 'updated_before', 'updated_after', 'model_uuid', '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_parts" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'limit' is set if self.api_client.client_side_validation and ( 'limit' not in local_var_params or # noqa: E501 local_var_params['limit'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `limit` when calling `get_parts`" ) # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[ 'limit'] > 1000: # noqa: E501 raise ApiValueError( "Invalid value for parameter `limit` when calling `get_parts`, must be a value less than or equal to `1000`" ) # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[ 'limit'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `limit` when calling `get_parts`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and ( 'uuid' in local_var_params and # noqa: E501 len(local_var_params['uuid']) > 100): # noqa: E501 raise ApiValueError( "Invalid value for parameter `uuid` when calling `get_parts`, number of items must be less than or equal to `100`" ) # noqa: E501 if self.api_client.client_side_validation and ( 'uuid' in local_var_params and # noqa: E501 len(local_var_params['uuid']) < 1): # noqa: E501 raise ApiValueError( "Invalid value for parameter `uuid` when calling `get_parts`, number of items must be greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and ( 'application_uuid' in local_var_params and # noqa: E501 len(local_var_params['application_uuid']) > 100): # noqa: E501 raise ApiValueError( "Invalid value for parameter `application_uuid` when calling `get_parts`, number of items must be less than or equal to `100`" ) # noqa: E501 if self.api_client.client_side_validation and ( 'application_uuid' in local_var_params and # noqa: E501 len(local_var_params['application_uuid']) < 1): # noqa: E501 raise ApiValueError( "Invalid value for parameter `application_uuid` when calling `get_parts`, number of items must be greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and ( 'model_uuid' in local_var_params and # noqa: E501 len(local_var_params['model_uuid']) > 100): # noqa: E501 raise ApiValueError( "Invalid value for parameter `model_uuid` when calling `get_parts`, number of items must be less than or equal to `100`" ) # noqa: E501 if self.api_client.client_side_validation and ( 'model_uuid' in local_var_params and # noqa: E501 len(local_var_params['model_uuid']) < 1): # noqa: E501 raise ApiValueError( "Invalid value for parameter `model_uuid` when calling `get_parts`, number of items must be greater than or equal to `1`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'limit' in local_var_params and local_var_params[ 'limit'] is not None: # noqa: E501 query_params.append( ('limit', local_var_params['limit'])) # noqa: E501 if 'cursor' in local_var_params and local_var_params[ 'cursor'] is not None: # noqa: E501 query_params.append( ('cursor', local_var_params['cursor'])) # noqa: E501 if 'uuid' in local_var_params and local_var_params[ 'uuid'] is not None: # noqa: E501 query_params.append( ('uuid', local_var_params['uuid'])) # noqa: E501 collection_formats['uuid'] = 'multi' # noqa: E501 if 'application_uuid' in local_var_params and local_var_params[ 'application_uuid'] is not None: # noqa: E501 query_params.append( ('application_uuid', local_var_params['application_uuid'])) # noqa: E501 collection_formats['application_uuid'] = 'multi' # noqa: E501 if 'updated_before' in local_var_params and local_var_params[ 'updated_before'] is not None: # noqa: E501 query_params.append( ('updated_before', local_var_params['updated_before'])) # noqa: E501 if 'updated_after' in local_var_params and local_var_params[ 'updated_after'] is not None: # noqa: E501 query_params.append( ('updated_after', local_var_params['updated_after'])) # noqa: E501 if 'model_uuid' in local_var_params and local_var_params[ 'model_uuid'] is not None: # noqa: E501 query_params.append( ('model_uuid', local_var_params['model_uuid'])) # noqa: E501 collection_formats['model_uuid'] = 'multi' # 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 collection_formats['sort'] = 'multi' # 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 = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( '/parts', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PartsResponse', # 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_printer_queues_with_http_info(self, **kwargs): # noqa: E501 """Fetch all printers' queues # noqa: E501 Fetch all printers and their queues. Sorted in queue order (first queue item will print next). # 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_printer_queues_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param list[str] printer_serial: Array of printer serials to limit the query :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(PrinterQueuesResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['printer_serial'] 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_printer_queues" % key) local_var_params[key] = val del local_var_params['kwargs'] if self.api_client.client_side_validation and ( 'printer_serial' in local_var_params and # noqa: E501 len(local_var_params['printer_serial']) > 100): # noqa: E501 raise ApiValueError( "Invalid value for parameter `printer_serial` when calling `get_printer_queues`, number of items must be less than or equal to `100`" ) # noqa: E501 if self.api_client.client_side_validation and ( 'printer_serial' in local_var_params and # noqa: E501 len(local_var_params['printer_serial']) < 1): # noqa: E501 raise ApiValueError( "Invalid value for parameter `printer_serial` when calling `get_printer_queues`, number of items must be greater than or equal to `1`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'printer_serial' in local_var_params and local_var_params[ 'printer_serial'] is not None: # noqa: E501 query_params.append( ('printer_serial', local_var_params['printer_serial'])) # noqa: E501 collection_formats['printer_serial'] = 'multi' # 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 = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( '/printers/queues', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PrinterQueuesResponse', # 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_part_order_with_http_info(self, uuid, **kwargs): # noqa: E501 """Cancel a PartOrder # noqa: E501 Cancel an existing eligible PartOrder. Part orders may only be canceled while they are in 'open' status. # 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_part_order_with_http_info(uuid, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str uuid: Carbon-generated part order UUID (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 = [ 'uuid' ] 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_part_order" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'uuid' is set if self.api_client.client_side_validation and ('uuid' not in local_var_params or # noqa: E501 local_var_params['uuid'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `uuid` when calling `delete_part_order`") # noqa: E501 collection_formats = {} path_params = {} if 'uuid' in local_var_params: path_params['uuid'] = local_var_params['uuid'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( '/part_orders/{uuid}', '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 get_prints_with_http_info(self, limit, offset, **kwargs): # noqa: E501 """List finished prints information # 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_prints_with_http_info(limit, offset, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param int limit: Max records to return (required) :param int offset: Number of items to skip (required) :param str platform_serial: Platform used for print :param str printer_serial: Serial of the Printer used to print :param str printer_name: Name of the Printer used to print :param str print_order_uuid: UUID of the print_order submitted :param str print_order_number: Number of the print_order submitted :param str started_before: Print started before timestamp (inclusive) :param str started_after: Print started after timestamp (inclusive) :param str finished_before: Print finished before timestamp (inclusive) :param str finished_after: Print finished after timestamp (inclusive) :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(PrintsResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'limit', 'offset', 'platform_serial', 'printer_serial', 'printer_name', 'print_order_uuid', 'print_order_number', 'started_before', 'started_after', 'finished_before', 'finished_after' ] 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_prints" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'limit' is set if self.api_client.client_side_validation and ( 'limit' not in local_var_params or # noqa: E501 local_var_params['limit'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `limit` when calling `get_prints`" ) # noqa: E501 # verify the required parameter 'offset' is set if self.api_client.client_side_validation and ( 'offset' not in local_var_params or # noqa: E501 local_var_params['offset'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `offset` when calling `get_prints`" ) # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[ 'limit'] > 1000: # noqa: E501 raise ApiValueError( "Invalid value for parameter `limit` when calling `get_prints`, must be a value less than or equal to `1000`" ) # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[ 'limit'] < 1: # noqa: E501 raise ApiValueError( "Invalid value for parameter `limit` when calling `get_prints`, must be a value greater than or equal to `1`" ) # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params[ 'offset'] < 0: # noqa: E501 raise ApiValueError( "Invalid value for parameter `offset` when calling `get_prints`, must be a value greater than or equal to `0`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'platform_serial' in local_var_params and local_var_params[ 'platform_serial'] is not None: # noqa: E501 query_params.append( ('platform_serial', local_var_params['platform_serial'])) # noqa: E501 if 'printer_serial' in local_var_params and local_var_params[ 'printer_serial'] is not None: # noqa: E501 query_params.append( ('printer_serial', local_var_params['printer_serial'])) # noqa: E501 if 'printer_name' in local_var_params and local_var_params[ 'printer_name'] is not None: # noqa: E501 query_params.append( ('printer_name', local_var_params['printer_name'])) # noqa: E501 if 'print_order_uuid' in local_var_params and local_var_params[ 'print_order_uuid'] is not None: # noqa: E501 query_params.append( ('print_order_uuid', local_var_params['print_order_uuid'])) # noqa: E501 if 'print_order_number' in local_var_params and local_var_params[ 'print_order_number'] is not None: # noqa: E501 query_params.append( ('print_order_number', local_var_params['print_order_number'])) # noqa: E501 if 'started_before' in local_var_params and local_var_params[ 'started_before'] is not None: # noqa: E501 query_params.append( ('started_before', local_var_params['started_before'])) # noqa: E501 if 'started_after' in local_var_params and local_var_params[ 'started_after'] is not None: # noqa: E501 query_params.append( ('started_after', local_var_params['started_after'])) # noqa: E501 if 'finished_before' in local_var_params and local_var_params[ 'finished_before'] is not None: # noqa: E501 query_params.append( ('finished_before', local_var_params['finished_before'])) # noqa: E501 if 'finished_after' in local_var_params and local_var_params[ 'finished_after'] is not None: # noqa: E501 query_params.append( ('finished_after', local_var_params['finished_after'])) # noqa: E501 if 'limit' in local_var_params and local_var_params[ 'limit'] is not None: # noqa: E501 query_params.append( ('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params[ 'offset'] is not None: # noqa: E501 query_params.append( ('offset', local_var_params['offset'])) # 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 = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( '/prints', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='PrintsResponse', # 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)