Beispiel #1
0
    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)
Beispiel #2
0
    def create_part_with_http_info(self, **kwargs):  # noqa: E501
        """Create a Part  # noqa: E501

        Create a part from a model.  # 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_part_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param PartRequest part_request: A new Part to be created.
        :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(Part, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['part_request']
        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_part" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'part_request' in local_var_params:
            body_params = local_var_params['part_request']
        # 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 = ['bearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/parts',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Part',  # 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)
Beispiel #3
0
    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)
Beispiel #4
0
    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)
Beispiel #5
0
    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)
Beispiel #6
0
    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)
Beispiel #7
0
    def get_applications_with_http_info(self, **kwargs):  # noqa: E501
        """Fetch all applications summary  # noqa: E501

        Fetch all available applications and their names, descriptions, and uuids. Sorted by uuid, ascending.  # 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_applications_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :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(ApplicationsResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = []
        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_applications" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # 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(
            '/applications',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApplicationsResponse',  # 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)
Beispiel #8
0
    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)