Пример #1
0
    def api_web_route_controller_index_with_http_info(self, **kwargs):  # noqa: E501
        """api_web_route_controller_index  # noqa: E501

        List of routes.  ## Names and Descriptions  There are 3 attributes with increasing details for naming and describing the route.  1. `/data/{index}/attributes/short_name` 2. `/data/{index}/attributes/long_name` 3. `/data/{index}/attributes/description`  ## Directions  `/data/{index}/attributes/direction_names` is the only place to convert the `direction_id` used throughout the rest of the API to human-readable names.  ## Type  `/data/{index}/attributes/type` corresponds to [GTFS `routes.txt` `route_type`](https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md#routestxt).  | Value | Name          | Example    | |-------|---------------|------------| | `0`   | Light Rail    | Green Line | | `1`   | Heavy Rail    | Red Line   | | `2`   | Commuter Rail |            | | `3`   | Bus           |            | | `4`   | Ferry         |            |     # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_web_route_controller_index_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int page_offset: Offset (0-based) of first element in the page
        :param int page_limit: Max number of elements to return
        :param str sort: Results can be [sorted](http://jsonapi.org/format/#fetching-sorting) by the id or any `/data/{index}/attributes` key. Assumes ascending; may be prefixed with '-' for descending  | JSON pointer | Direction | `sort`     | |--------------|-----------|------------| | `/data/{index}/attributes/color` | ascending | `color` | | `/data/{index}/attributes/color` | descending | `-color` | | `/data/{index}/attributes/description` | ascending | `description` | | `/data/{index}/attributes/description` | descending | `-description` | | `/data/{index}/attributes/direction_destinations` | ascending | `direction_destinations` | | `/data/{index}/attributes/direction_destinations` | descending | `-direction_destinations` | | `/data/{index}/attributes/direction_names` | ascending | `direction_names` | | `/data/{index}/attributes/direction_names` | descending | `-direction_names` | | `/data/{index}/attributes/fare_class` | ascending | `fare_class` | | `/data/{index}/attributes/fare_class` | descending | `-fare_class` | | `/data/{index}/attributes/long_name` | ascending | `long_name` | | `/data/{index}/attributes/long_name` | descending | `-long_name` | | `/data/{index}/attributes/short_name` | ascending | `short_name` | | `/data/{index}/attributes/short_name` | descending | `-short_name` | | `/data/{index}/attributes/sort_order` | ascending | `sort_order` | | `/data/{index}/attributes/sort_order` | descending | `-sort_order` | | `/data/{index}/attributes/text_color` | ascending | `text_color` | | `/data/{index}/attributes/text_color` | descending | `-text_color` | | `/data/{index}/attributes/type` | ascending | `type` | | `/data/{index}/attributes/type` | descending | `-type` |  
        :param str fields_route: Fields to include with the response. Multiple fields **MUST** be a comma-separated (U+002C COMMA, \",\") list.  Note that fields can also be selected for included data types: see the [V3 API Best Practices](https://www.mbta.com/developers/v3-api/best-practices) for an example. 
        :param str include: Relationships to include.  * `stop` * `line` * `route_patterns`  The value of the include parameter **MUST** be a comma-separated (U+002C COMMA, \",\") list of relationship paths. A relationship path is a dot-separated (U+002E FULL-STOP, \".\") list of relationship names. [JSONAPI \"include\" behavior](http://jsonapi.org/format/#fetching-includes)  include=stop only works when `filter[stop]` is also used 
        :param str filter_stop: Filter by `/data/{index}/relationships/stop/data/id`. Must filter by stop in order to include stop with response
        :param str filter_type: | Value | Name          | Example    | |-------|---------------|------------| | `0`   | Light Rail    | Green Line | | `1`   | Heavy Rail    | Red Line   | | `2`   | Commuter Rail |            | | `3`   | Bus           |            | | `4`   | Ferry         |            |   Multiple `route_type` **MUST** be a comma-separated (U+002C COMMA, \",\") list. 
        :param str filter_direction_id: Filter by direction of travel along the route.  The meaning of `direction_id` varies based on the route. You can programmatically get the direction names from `/routes` `/data/{index}/attributes/direction_names` or `/routes/{id}` `/data/attributes/direction_names`.   When combined with stop_id, filters by routes which stop at that stop when traveling in a particular direction 
        :param date filter_date: Filter by date that route is active The active date is the service date. Trips that begin between midnight and 3am are considered part of the previous service day. The format is ISO8601 with the template of YYYY-MM-DD.
        :param str filter_id: Filter by multiple IDs. Multiple IDs **MUST** be a comma-separated (U+002C COMMA, \",\") list.
        :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(Routes, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['page_offset', 'page_limit', 'sort', 'fields_route', 'include', 'filter_stop', 'filter_type', 'filter_direction_id', 'filter_date', 'filter_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_web_route_controller_index" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        if self.api_client.client_side_validation and 'page_offset' in local_var_params and local_var_params['page_offset'] < 0:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `page_offset` when calling `api_web_route_controller_index`, must be a value greater than or equal to `0`")  # noqa: E501
        if self.api_client.client_side_validation and 'page_limit' in local_var_params and local_var_params['page_limit'] < 1:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `page_limit` when calling `api_web_route_controller_index`, must be a value greater than or equal to `1`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'page_offset' in local_var_params and local_var_params['page_offset'] is not None:  # noqa: E501
            query_params.append(('page[offset]', local_var_params['page_offset']))  # noqa: E501
        if 'page_limit' in local_var_params and local_var_params['page_limit'] is not None:  # noqa: E501
            query_params.append(('page[limit]', local_var_params['page_limit']))  # 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
        if 'fields_route' in local_var_params and local_var_params['fields_route'] is not None:  # noqa: E501
            query_params.append(('fields[route]', local_var_params['fields_route']))  # 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
        if 'filter_stop' in local_var_params and local_var_params['filter_stop'] is not None:  # noqa: E501
            query_params.append(('filter[stop]', local_var_params['filter_stop']))  # noqa: E501
        if 'filter_type' in local_var_params and local_var_params['filter_type'] is not None:  # noqa: E501
            query_params.append(('filter[type]', local_var_params['filter_type']))  # noqa: E501
        if 'filter_direction_id' in local_var_params and local_var_params['filter_direction_id'] is not None:  # noqa: E501
            query_params.append(('filter[direction_id]', local_var_params['filter_direction_id']))  # noqa: E501
        if 'filter_date' in local_var_params and local_var_params['filter_date'] is not None:  # noqa: E501
            query_params.append(('filter[date]', local_var_params['filter_date']))  # noqa: E501
        if 'filter_id' in local_var_params and local_var_params['filter_id'] is not None:  # noqa: E501
            query_params.append(('filter[id]', local_var_params['filter_id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.api+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key_in_header', 'api_key_in_query']  # noqa: E501

        return self.api_client.call_api(
            '/routes', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Routes',  # 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)
Пример #2
0
    def answer_controller_update_by_id_with_http_info(self, id,
                                                      **kwargs):  # noqa: E501
        """answer_controller_update_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.answer_controller_update_by_id_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param float id: (required)
        :param AnswerPartial answer_partial:
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['id', 'answer_partial']
        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 answer_controller_update_by_id" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and (
                'id' not in local_var_params or  # noqa: E501
                local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `id` when calling `answer_controller_update_by_id`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in local_var_params:
            path_params['id'] = local_var_params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'answer_partial' in local_var_params:
            body_params = local_var_params['answer_partial']
        # HTTP header `Content-Type`
        header_params[
            'Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
                ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/answers/{id}',
            'PATCH',
            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)
Пример #3
0
    def primary_lead_sources_get_active_primary_lead_sources_with_http_info(
            self, company_id, **kwargs):  # noqa: E501
        """List active primary lead sources  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.primary_lead_sources_get_active_primary_lead_sources_with_http_info(company_id, async_req=True)
        >>> result = thread.get()

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

        local_var_params = locals()

        all_params = ['company_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 primary_lead_sources_get_active_primary_lead_sources"
                    % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'company_id' is set
        if self.api_client.client_side_validation and (
                'company_id' not in local_var_params or  # noqa: E501
                local_var_params['company_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `company_id` when calling `primary_lead_sources_get_active_primary_lead_sources`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'company_id' in local_var_params:
            path_params['companyId'] = local_var_params[
                'company_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', 'text/json', 'application/xml',
             'text/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/companies/{companyId}/primaryleadsources/active',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=
            'list[SimplePrimaryLeadSourceResourceModel]',  # 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)
Пример #4
0
    def create_transaction_with_http_info(self, payment_identifier,
                                          redirect_uri,
                                          **kwargs):  # noqa: E501
        """Create a transaction  # noqa: E501

        Creates a transaction for the payment.  # 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_transaction_with_http_info(payment_identifier, redirect_uri, async_req=True)
        >>> result = thread.get()

        :param payment_identifier: (required)
        :type payment_identifier: str
        :param redirect_uri: Redirect URI (required)
        :type redirect_uri: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(Transaction, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ['payment_identifier', 'redirect_uri']
        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_transaction" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'payment_identifier' is set
        if self.api_client.client_side_validation and (
                'payment_identifier' not in local_var_params or  # noqa: E501
                local_var_params['payment_identifier'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `payment_identifier` when calling `create_transaction`"
            )  # noqa: E501
        # verify the required parameter 'redirect_uri' is set
        if self.api_client.client_side_validation and (
                'redirect_uri' not in local_var_params or  # noqa: E501
                local_var_params['redirect_uri'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `redirect_uri` when calling `create_transaction`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'payment_identifier' in local_var_params:
            path_params['payment_identifier'] = local_var_params[
                'payment_identifier']  # noqa: E501

        query_params = []
        if 'redirect_uri' in local_var_params and local_var_params[
                'redirect_uri'] is not None:  # noqa: E501
            query_params.append(
                ('redirect_uri',
                 local_var_params['redirect_uri']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/payment-requests/{payment_identifier}/transactions',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Transaction',  # 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)
Пример #5
0
    def get_bank_accounts_key_with_http_info(self, key, **kwargs):  # noqa: E501
        """Returns a Bank Account  # noqa: E501

        Returns a Bank Account  ### Endpoint Availability  * Accounting: 🇨🇦, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸 * Accounting Start: 🇨🇦, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸  ### Access Control Restrictions  Requires the authenticated user to have any of the following roles in the area `Bank`: Full Access, Read Only, Restricted Access  # 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_bank_accounts_key_with_http_info(key, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str key: The Bank Account Key. (required)
        :param str nested_attributes: Specify the attributes that you want to expose for nested entities of the Bank Account (expose all nested attributes with 'all'). These are in addition to the base attributes (name, path)
        :param bool show_legacy_id: Display the legacy_id for the Bank Account.
        :param str attributes: Specify the attributes that you want to expose for the Bank Account (expose all attributes with 'all'). These are in addition to the base attributes (name, path)
        :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(BankAccount, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['key', 'nested_attributes', 'show_legacy_id', 'attributes']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_bank_accounts_key" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and ('key' not in local_var_params or  # noqa: E501
                                                        local_var_params['key'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `key` when calling `get_bank_accounts_key`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'key' in local_var_params:
            path_params['key'] = local_var_params['key']  # noqa: E501

        query_params = []
        if 'nested_attributes' in local_var_params and local_var_params['nested_attributes'] is not None:  # noqa: E501
            query_params.append(('nested_attributes', local_var_params['nested_attributes']))  # noqa: E501
        if 'show_legacy_id' in local_var_params and local_var_params['show_legacy_id'] is not None:  # noqa: E501
            query_params.append(('show_legacy_id', local_var_params['show_legacy_id']))  # noqa: E501
        if 'attributes' in local_var_params and local_var_params['attributes'] is not None:  # noqa: E501
            query_params.append(('attributes', local_var_params['attributes']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/bank_accounts/{key}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BankAccount',  # 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)
Пример #6
0
    def get_l2_order_book_with_http_info(self, symbol, **kwargs):  # noqa: E501
        """L2 Order Book  # noqa: E501

        Level 2 Order Book data is available through the l2 channel. Each entry in bids and asks arrays is a price level, along with its price (px), quantity (qty) and number of orders (num) attributes.  # 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_l2_order_book_with_http_info(symbol, async_req=True)
        >>> result = thread.get()

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

        local_var_params = locals()

        all_params = [
            'symbol'
        ]
        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_l2_order_book" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'symbol' is set
        if self.api_client.client_side_validation and ('symbol' not in local_var_params or  # noqa: E501
                                                        local_var_params['symbol'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `symbol` when calling `get_l2_order_book`")  # noqa: E501

        if self.api_client.client_side_validation and 'symbol' in local_var_params and not re.search(r'^[A-Z]{3,5}-[A-Z]{3,5}$', local_var_params['symbol']):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `symbol` when calling `get_l2_order_book`, must conform to the pattern `/^[A-Z]{3,5}-[A-Z]{3,5}$/`")  # noqa: E501
        collection_formats = {}

        path_params = {}
        if 'symbol' in local_var_params:
            path_params['symbol'] = local_var_params['symbol']  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/l2/{symbol}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrderBook',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
    def cancel_normal_order_with_http_info(self, consumerKey, sessionToken,
                                           orderId, **kwargs):  # noqa: E501
        """Cancel a Normal order  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.cancel_normal_order_with_http_info(consumerKey, sessionToken, orderId, async_req=True)
        >>> result = thread.get()

        :param consumerKey: (required)
        :type consumerKey: str
        :param sessionToken: (required)
        :type sessionToken: str
        :param orderId: Order ID to cancel. (required)
        :type orderId: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(ResNormalOrderCancel, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = ['consumerKey', 'sessionToken', 'orderId']
        all_params.extend([
            'async_req', '_return_http_data_only', '_preload_content',
            '_request_timeout', '_request_auth'
        ])

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method cancel_normal_order" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'consumerKey' is set
        if self.api_client.client_side_validation and (
                'consumerKey' not in local_var_params or  # noqa: E501
                local_var_params['consumerKey'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `consumerKey` when calling `cancel_normal_order`"
            )  # noqa: E501
        # verify the required parameter 'sessionToken' is set
        if self.api_client.client_side_validation and (
                'sessionToken' not in local_var_params or  # noqa: E501
                local_var_params['sessionToken'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `sessionToken` when calling `cancel_normal_order`"
            )  # noqa: E501
        # verify the required parameter 'orderId' is set
        if self.api_client.client_side_validation and (
                'orderId' not in local_var_params or  # noqa: E501
                local_var_params['orderId'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `orderId` when calling `cancel_normal_order`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'orderId' in local_var_params:
            path_params['orderId'] = local_var_params['orderId']  # noqa: E501

        query_params = []

        header_params = {}
        if 'consumerKey' in local_var_params:
            header_params['consumerKey'] = local_var_params[
                'consumerKey']  # noqa: E501
        if 'sessionToken' in local_var_params:
            header_params['sessionToken'] = local_var_params[
                'sessionToken']  # noqa: E501

        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(
            '/orders/1.0/order/normal/{orderId}',
            'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResNormalOrderCancel',  # 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,
            _request_auth=local_var_params.get('_request_auth'))
Пример #8
0
    def get_abap_findings_with_http_info(self, project, object_type,
                                         source_object,
                                         **kwargs):  # noqa: E501
        """Get ABAP findings  # noqa: E501

        Returns findings for an ABAP source object, function group, or project. The element is expected in the form OBJTYPE/OBJNAME, e.g. 'PROG/ZTEST' or 'FUGR/!ABC!MY_FUNCTION_GROUP'. This service is public API since Teamscale 5.6. The API requires the user to have View Project permissions on the project.  # 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_abap_findings_with_http_info(project, object_type, source_object, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str project: The project alias or id. (required)
        :param str object_type: (required)
        :param str source_object: (required)
        :param str t: This parameter can be used to pass a timestamp giving the time (in milliseconds since 1970) for which the data should be provided. This can optionally be prefixed by the name of the branch, followed by a colon.
        :param str regex: The regex filter. Filters findings by this regex. Considered Fields are Message and Location. Matches will be included in the result.
        :param bool exclude_regex: Whether regex excludes or includes findings.
        :param bool added_to_task: The added to task filter. Filter findings that already have a task assigned.
        :param list[str] filter: The finding category and group filter. Notation: category/group. The group part is optional. If a category or group is given, all matching findings will be filtered out and not included in the result.
        :param bool invert: Whether to invert the category and group filter.
        :param list[str] assessment_filters: The assessment filter. All mentioned assessment colors will be filtered out and not included in the result.
        :param str blacklisted: The blacklist filtering option.
        :param str baseline: The baseline name or baseline timestamp, with regards to which the findings shall be filtered.
        :param str qualified_name: If this parameter is given, general findings and such covering the specified qualified location are returned.
        :param bool include_changed_code_findings: If this is true, findings in changed code as included as well. Only used if a baseline is provided as well.
        :param str blacklist_rationale: A pattern to be matched against the rationale for which the findings was tolerated or marked as false positive.
        :param str sort_by: The finding property by which the result is sorted. If none is given the result is not sorted. One of group, location, message, or a finding property, or random
        :param str sort_order: The sort order
        :param int start: If this parameter is given, the findings returned will start from this index (0 based), i.e. the first start findings in the list (for current sorting) will be skipped.
        :param int max: Limits the number of findings returned. If also the parameter 'all' is used, the limit is ignored. Providing no limit will use the default limit of 300.
        :param bool all: If this is true, the finding list is not truncated to 300 elements.
        :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(FindingsWithCount, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'project', 'object_type', 'source_object', 't', 'regex',
            'exclude_regex', 'added_to_task', 'filter', 'invert',
            'assessment_filters', 'blacklisted', 'baseline', 'qualified_name',
            'include_changed_code_findings', 'blacklist_rationale', 'sort_by',
            'sort_order', 'start', 'max', 'all'
        ]
        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_abap_findings" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'project' is set
        if self.api_client.client_side_validation and (
                'project' not in local_var_params or  # noqa: E501
                local_var_params['project'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `project` when calling `get_abap_findings`"
            )  # noqa: E501
        # verify the required parameter 'object_type' is set
        if self.api_client.client_side_validation and (
                'object_type' not in local_var_params or  # noqa: E501
                local_var_params['object_type'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `object_type` when calling `get_abap_findings`"
            )  # noqa: E501
        # verify the required parameter 'source_object' is set
        if self.api_client.client_side_validation and (
                'source_object' not in local_var_params or  # noqa: E501
                local_var_params['source_object'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `source_object` when calling `get_abap_findings`"
            )  # noqa: E501

        if self.api_client.client_side_validation and 'project' in local_var_params and not re.search(
                r'^(?!aliases$)[-_.a-zA-Z0-9]+$',
                local_var_params['project']):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `project` when calling `get_abap_findings`, must conform to the pattern `/^(?!aliases$)[-_.a-zA-Z0-9]+$/`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 't' in local_var_params and not re.search(
                r'(?:(.+):)?(HEAD|\d+)(?:p(\d+))?',
                local_var_params['t']):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `t` when calling `get_abap_findings`, must conform to the pattern `/(?:(.+):)?(HEAD|\d+)(?:p(\d+))?/`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}
        if 'project' in local_var_params:
            path_params['project'] = local_var_params['project']  # noqa: E501
        if 'object_type' in local_var_params:
            path_params['objectType'] = local_var_params[
                'object_type']  # noqa: E501
        if 'source_object' in local_var_params:
            path_params['sourceObject'] = local_var_params[
                'source_object']  # noqa: E501

        query_params = []
        if 't' in local_var_params and local_var_params[
                't'] is not None:  # noqa: E501
            query_params.append(('t', local_var_params['t']))  # noqa: E501
        if 'regex' in local_var_params and local_var_params[
                'regex'] is not None:  # noqa: E501
            query_params.append(
                ('regex', local_var_params['regex']))  # noqa: E501
        if 'exclude_regex' in local_var_params and local_var_params[
                'exclude_regex'] is not None:  # noqa: E501
            query_params.append(
                ('exclude-regex',
                 local_var_params['exclude_regex']))  # noqa: E501
        if 'added_to_task' in local_var_params and local_var_params[
                'added_to_task'] is not None:  # noqa: E501
            query_params.append(
                ('added-to-task',
                 local_var_params['added_to_task']))  # noqa: E501
        if 'filter' in local_var_params and local_var_params[
                'filter'] is not None:  # noqa: E501
            query_params.append(
                ('filter', local_var_params['filter']))  # noqa: E501
            collection_formats['filter'] = 'multi'  # noqa: E501
        if 'invert' in local_var_params and local_var_params[
                'invert'] is not None:  # noqa: E501
            query_params.append(
                ('invert', local_var_params['invert']))  # noqa: E501
        if 'assessment_filters' in local_var_params and local_var_params[
                'assessment_filters'] is not None:  # noqa: E501
            query_params.append(
                ('assessment-filters',
                 local_var_params['assessment_filters']))  # noqa: E501
            collection_formats['assessment-filters'] = 'multi'  # noqa: E501
        if 'blacklisted' in local_var_params and local_var_params[
                'blacklisted'] is not None:  # noqa: E501
            query_params.append(
                ('blacklisted', local_var_params['blacklisted']))  # noqa: E501
        if 'baseline' in local_var_params and local_var_params[
                'baseline'] is not None:  # noqa: E501
            query_params.append(
                ('baseline', local_var_params['baseline']))  # noqa: E501
        if 'qualified_name' in local_var_params and local_var_params[
                'qualified_name'] is not None:  # noqa: E501
            query_params.append(
                ('qualified-name',
                 local_var_params['qualified_name']))  # noqa: E501
        if 'include_changed_code_findings' in local_var_params and local_var_params[
                'include_changed_code_findings'] is not None:  # noqa: E501
            query_params.append(
                ('include-changed-code-findings',
                 local_var_params['include_changed_code_findings']
                 ))  # noqa: E501
        if 'blacklist_rationale' in local_var_params and local_var_params[
                'blacklist_rationale'] is not None:  # noqa: E501
            query_params.append(
                ('blacklistRationale',
                 local_var_params['blacklist_rationale']))  # noqa: E501
        if 'sort_by' in local_var_params and local_var_params[
                'sort_by'] is not None:  # noqa: E501
            query_params.append(
                ('sort-by', local_var_params['sort_by']))  # noqa: E501
        if 'sort_order' in local_var_params and local_var_params[
                'sort_order'] is not None:  # noqa: E501
            query_params.append(
                ('sort-order', local_var_params['sort_order']))  # noqa: E501
        if 'start' in local_var_params and local_var_params[
                'start'] is not None:  # noqa: E501
            query_params.append(
                ('start', local_var_params['start']))  # noqa: E501
        if 'max' in local_var_params and local_var_params[
                'max'] is not None:  # noqa: E501
            query_params.append(('max', local_var_params['max']))  # noqa: E501
        if 'all' in local_var_params and local_var_params[
                'all'] is not None:  # noqa: E501
            query_params.append(('all', local_var_params['all']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['text/xml', 'application/xml', 'application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/api/projects/{project}/findings/abap/{objectType}/{sourceObject}',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='FindingsWithCount',  # 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)
Пример #9
0
    def calculate_fees_with_http_info(self, corp_type, filing_type_code, **kwargs):  # noqa: E501
        """Calculate Fees  # noqa: E501

        Calculate Fees on the filing type for corp type  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.calculate_fees_with_http_info(corp_type, filing_type_code, async_req=True)
        >>> result = thread.get()

        :param corp_type: Corp Type (required)
        :type corp_type: str
        :param filing_type_code: Filing type code (required)
        :type filing_type_code: str
        :param jurisdiction: Jurisdiction or Province code
        :type jurisdiction: str
        :param date: Date on which the filing rates are applicable
        :type date: str
        :param priority: Indicator if priority fees are applicable
        :type priority: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(Fee, status_code(int), headers(HTTPHeaderDict))
        """

        local_var_params = locals()

        all_params = [
            'corp_type',
            'filing_type_code',
            'jurisdiction',
            'date',
            'priority'
        ]
        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 calculate_fees" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'corp_type' is set
        if self.api_client.client_side_validation and ('corp_type' not in local_var_params or  # noqa: E501
                                                        local_var_params['corp_type'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `corp_type` when calling `calculate_fees`")  # noqa: E501
        # verify the required parameter 'filing_type_code' is set
        if self.api_client.client_side_validation and ('filing_type_code' not in local_var_params or  # noqa: E501
                                                        local_var_params['filing_type_code'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `filing_type_code` when calling `calculate_fees`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'corp_type' in local_var_params:
            path_params['corp_type'] = local_var_params['corp_type']  # noqa: E501
        if 'filing_type_code' in local_var_params:
            path_params['filing_type_code'] = local_var_params['filing_type_code']  # noqa: E501

        query_params = []
        if 'jurisdiction' in local_var_params and local_var_params['jurisdiction'] is not None:  # noqa: E501
            query_params.append(('jurisdiction', local_var_params['jurisdiction']))  # noqa: E501
        if 'date' in local_var_params and local_var_params['date'] is not None:  # noqa: E501
            query_params.append(('date', local_var_params['date']))  # noqa: E501
        if 'priority' in local_var_params and local_var_params['priority'] is not None:  # noqa: E501
            query_params.append(('priority', local_var_params['priority']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/fees/{corp_type}/{filing_type_code}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Fee',  # 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 device_channel_controller_find_by_period_with_http_info(self, device_id, channel_id, from_ts, to_ts, page, count, group_by, operation, **kwargs):  # noqa: E501
        """device_channel_controller_find_by_period  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.device_channel_controller_find_by_period_with_http_info(device_id, channel_id, from_ts, to_ts, page, count, group_by, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param float device_id: (required)
        :param float channel_id: (required)
        :param str from_ts: (required)
        :param str to_ts: (required)
        :param float page: (required)
        :param float count: (required)
        :param str group_by: (required)
        :param str operation: (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(ResponseDeviceChannelData, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'device_id',
            'channel_id',
            'from_ts',
            'to_ts',
            'page',
            'count',
            'group_by',
            'operation'
        ]
        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 device_channel_controller_find_by_period" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'device_id' is set
        if self.api_client.client_side_validation and ('device_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['device_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `device_id` when calling `device_channel_controller_find_by_period`")  # noqa: E501
        # verify the required parameter 'channel_id' is set
        if self.api_client.client_side_validation and ('channel_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['channel_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `channel_id` when calling `device_channel_controller_find_by_period`")  # noqa: E501
        # verify the required parameter 'from_ts' is set
        if self.api_client.client_side_validation and ('from_ts' not in local_var_params or  # noqa: E501
                                                        local_var_params['from_ts'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `from_ts` when calling `device_channel_controller_find_by_period`")  # noqa: E501
        # verify the required parameter 'to_ts' is set
        if self.api_client.client_side_validation and ('to_ts' not in local_var_params or  # noqa: E501
                                                        local_var_params['to_ts'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `to_ts` when calling `device_channel_controller_find_by_period`")  # noqa: E501
        # verify the required parameter 'page' is set
        if self.api_client.client_side_validation and ('page' not in local_var_params or  # noqa: E501
                                                        local_var_params['page'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `page` when calling `device_channel_controller_find_by_period`")  # noqa: E501
        # verify the required parameter 'count' is set
        if self.api_client.client_side_validation and ('count' not in local_var_params or  # noqa: E501
                                                        local_var_params['count'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `count` when calling `device_channel_controller_find_by_period`")  # noqa: E501
        # verify the required parameter 'group_by' is set
        if self.api_client.client_side_validation and ('group_by' not in local_var_params or  # noqa: E501
                                                        local_var_params['group_by'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `group_by` when calling `device_channel_controller_find_by_period`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in local_var_params or  # noqa: E501
                                                        local_var_params['operation'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `operation` when calling `device_channel_controller_find_by_period`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'device_id' in local_var_params:
            path_params['deviceId'] = local_var_params['device_id']  # noqa: E501
        if 'channel_id' in local_var_params:
            path_params['channelId'] = local_var_params['channel_id']  # noqa: E501
        if 'from_ts' in local_var_params:
            path_params['fromTS'] = local_var_params['from_ts']  # noqa: E501
        if 'to_ts' in local_var_params:
            path_params['toTs'] = local_var_params['to_ts']  # noqa: E501
        if 'page' in local_var_params:
            path_params['page'] = local_var_params['page']  # noqa: E501
        if 'count' in local_var_params:
            path_params['count'] = local_var_params['count']  # noqa: E501
        if 'group_by' in local_var_params:
            path_params['groupBy'] = local_var_params['group_by']  # noqa: E501
        if 'operation' in local_var_params:
            path_params['operation'] = local_var_params['operation']  # 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(
            '/device-channel/data-by-period/{deviceId}/{channelId}/from/{fromTS}/to/{toTs}/page/{page}/count/{count}/groupBy/{groupBy}/operation/{operation}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResponseDeviceChannelData',  # 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)
Пример #11
0
    def lookup_project_by_sap_system_id_with_http_info(self, sap_system_id,
                                                       **kwargs):  # noqa: E501
        """Get projects corresponding to given SAP system ID.  # noqa: E501

        Looks up Teamscale projects by SAP System ID. Returns project aliases or project IDs if no alias available. This service is public API since Teamscale 5.7. The service will only search among projects visible to current user.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.lookup_project_by_sap_system_id_with_http_info(sap_system_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str sap_system_id: System ID of SAP system (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(list[str], status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['sap_system_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 lookup_project_by_sap_system_id" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'sap_system_id' is set
        if self.api_client.client_side_validation and (
                'sap_system_id' not in local_var_params or  # noqa: E501
                local_var_params['sap_system_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `sap_system_id` when calling `lookup_project_by_sap_system_id`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'sap_system_id' in local_var_params:
            path_params['sap-system-id'] = local_var_params[
                'sap_system_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 = ['basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/api/projects-by-sap-system-id/{sap-system-id}',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[str]',  # 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 device_channel_controller_find_device_channel_last_ts_sn_ch_name_with_http_info(self, serial_no, channel_name, **kwargs):  # noqa: E501
        """device_channel_controller_find_device_channel_last_ts_sn_ch_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.device_channel_controller_find_device_channel_last_ts_sn_ch_name_with_http_info(serial_no, channel_name, async_req=True)
        >>> result = thread.get()

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

        local_var_params = locals()

        all_params = [
            'serial_no',
            'channel_name'
        ]
        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 device_channel_controller_find_device_channel_last_ts_sn_ch_name" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'serial_no' is set
        if self.api_client.client_side_validation and ('serial_no' not in local_var_params or  # noqa: E501
                                                        local_var_params['serial_no'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `serial_no` when calling `device_channel_controller_find_device_channel_last_ts_sn_ch_name`")  # noqa: E501
        # verify the required parameter 'channel_name' is set
        if self.api_client.client_side_validation and ('channel_name' not in local_var_params or  # noqa: E501
                                                        local_var_params['channel_name'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `channel_name` when calling `device_channel_controller_find_device_channel_last_ts_sn_ch_name`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'serial_no' in local_var_params:
            path_params['serialNo'] = local_var_params['serial_no']  # noqa: E501
        if 'channel_name' in local_var_params:
            path_params['channelName'] = local_var_params['channel_name']  # 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(
            '/device-channel/data-last-timestamp-by-name/{serialNo}/{channelName}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResponseDeviceChannelData',  # 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 public_set_heartbeat_get_with_http_info(self, interval,
                                                **kwargs):  # noqa: E501
        """Signals the Websocket connection to send and request heartbeats. Heartbeats can be used to detect stale connections. When heartbeats have been set up, the API server will send `heartbeat` messages and `test_request` messages. Your software should respond to `test_request` messages by sending a `/api/v2/public/test` request. If your software fails to do so, the API server will immediately close the connection. If your account is configured to cancel on disconnect, any orders opened over the connection will be cancelled.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.public_set_heartbeat_get_with_http_info(interval, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param float interval: The heartbeat interval in seconds, but not less than 10 (required)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['interval']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method public_set_heartbeat_get" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'interval' is set
        if ('interval' not in local_var_params
                or local_var_params['interval'] is None):
            raise ApiValueError(
                "Missing the required parameter `interval` when calling `public_set_heartbeat_get`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'interval' in local_var_params:
            query_params.append(
                ('interval', local_var_params['interval']))  # 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(
            '/public/set_heartbeat',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  # 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 set_settings_with_http_info(self, settings, **kwargs):  # noqa: E501
        """Set settings  # noqa: E501

        **webhookUrl** - Http or https URL for receiving notifications. For testing, we recommend using [our RequestBin](http://bin.chat-api.com).  **ackNotificationsOn** - Turn on/off ack (message delivered and message viewed) notifications in webhooks. GET method works for the same address.  **chatUpdateOn** - Turn on/off chat update notifications in webhooks. GET method works for the same address.  **videoUploadOn** - Turn on/off receiving video messages.  **proxy** - Socks5 IP address and port proxy for instance.  **guaranteedHooks** - Guarantee webhook delivery. Each webhook will make 20 attempts to send until it receives 200 status from the server.  **ignoreOldMessages** - Do not send webhooks with old messages during authorization.  **processArchive** - Process messages from archived chats.  **instanceStatuses** - Turn on/off collecting instance status changing history.  **webhookStatuses** - Turn on/off collecting messages webhooks statuses.  **statusNotificationsOn** - Turn on/off instance changind status notifications in webhooks.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_settings_with_http_info(settings, async_req=True)
        >>> result = thread.get()

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

        local_var_params = locals()

        all_params = ['settings']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method set_settings" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'settings' is set
        if ('settings' not in local_var_params or
                local_var_params['settings'] is None):
            raise ApiValueError("Missing the required parameter `settings` when calling `set_settings`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'settings' in local_var_params:
            body_params = local_var_params['settings']
        # 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', 'application/x-www-form-urlencoded'])  # noqa: E501

        # Authentication setting
        auth_settings = ['instanceId', 'token']  # noqa: E501

        return self.api_client.call_api(
            '/settings', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2005',  # 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)
Пример #15
0
    def get_budget_by_id_with_http_info(self, budget_id,
                                        **kwargs):  # noqa: E501
        """Single budget  # noqa: E501

        Returns a single budget with all related entities.  This resource is effectively a full budget export.  # 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_budget_by_id_with_http_info(budget_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str budget_id: The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget) (required)
        :param int last_knowledge_of_server: The starting server knowledge.  If provided, only entities that have changed since last_knowledge_of_server will be included.
        :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(BudgetDetailResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['budget_id', 'last_knowledge_of_server']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method get_budget_by_id" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'budget_id' is set
        if self.api_client.client_side_validation and (
                'budget_id' not in local_var_params or  # noqa: E501
                local_var_params['budget_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `budget_id` when calling `get_budget_by_id`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'budget_id' in local_var_params:
            path_params['budget_id'] = local_var_params[
                'budget_id']  # noqa: E501

        query_params = []
        if 'last_knowledge_of_server' in local_var_params and local_var_params[
                'last_knowledge_of_server'] is not None:  # noqa: E501
            query_params.append(
                ('last_knowledge_of_server',
                 local_var_params['last_knowledge_of_server']))  # 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 = ['bearer']  # noqa: E501

        return self.api_client.call_api(
            '/budgets/{budget_id}',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BudgetDetailResponse',  # 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)
Пример #16
0
 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,
                                         post_params=post_params,
                                         _preload_content=_preload_content,
                                         _request_timeout=_request_timeout,
                                         body=body)
     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`.")
Пример #17
0
    def get_symbol_by_name_with_http_info(self, symbol, **kwargs):  # noqa: E501
        """Symbols  # noqa: E501

        When the symbol is not halted the auction data in the message may be blank. When a symbol is in a halt state the auction data will populate as the book builds. When an opening time has been chosen, the auction-time field will show the opening time. Subsequent updates will be sent only if the symbol status changes in any way.  # 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_symbol_by_name_with_http_info(symbol, async_req=True)
        >>> result = thread.get()

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

        local_var_params = locals()

        all_params = [
            'symbol'
        ]
        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_symbol_by_name" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'symbol' is set
        if self.api_client.client_side_validation and ('symbol' not in local_var_params or  # noqa: E501
                                                        local_var_params['symbol'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `symbol` when calling `get_symbol_by_name`")  # noqa: E501

        if self.api_client.client_side_validation and 'symbol' in local_var_params and not re.search(r'^[A-Z]{3,5}-[A-Z]{3,5}$', local_var_params['symbol']):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `symbol` when calling `get_symbol_by_name`, must conform to the pattern `/^[A-Z]{3,5}-[A-Z]{3,5}$/`")  # noqa: E501
        collection_formats = {}

        path_params = {}
        if 'symbol' in local_var_params:
            path_params['symbol'] = local_var_params['symbol']  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/symbols/{symbol}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SymbolStatus',  # 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)
Пример #18
0
    def call_with_http_info(self, **kwargs):

        try:
            _host = self.settings['servers'][kwargs['_host_index']]
        except IndexError:
            if self.settings['servers']:
                raise ApiValueError(
                    "Invalid host index. Must be 0 <= index < %s" %
                    len(self.settings['servers'])
                )
            _host = None

        for key, value in six.iteritems(kwargs):
            if key not in self.params_map['all']:
                raise ApiTypeError(
                    "Got an unexpected parameter '%s'"
                    " to method `%s`" %
                    (key, self.settings['operation_id'])
                )
            # only throw this nullable ApiValueError if _check_input_type
            # is False, if _check_input_type==True we catch this case
            # in self.__validate_inputs
            if (key not in self.params_map['nullable'] and value is None
                    and kwargs['_check_input_type'] is False):
                raise ApiValueError(
                    "Value may not be None for non-nullable parameter `%s`"
                    " when calling `%s`" %
                    (key, self.settings['operation_id'])
                )

        for key in self.params_map['required']:
            if key not in kwargs.keys():
                raise ApiValueError(
                    "Missing the required parameter `%s` when calling "
                    "`%s`" % (key, self.settings['operation_id'])
                )

        self.__validate_inputs(kwargs)

        params = self.__gather_params(kwargs)

        accept_headers_list = self.headers_map['accept']
        if accept_headers_list:
            params['header']['Accept'] = self.api_client.select_header_accept(
                accept_headers_list)

        content_type_headers_list = self.headers_map['content_type']
        if content_type_headers_list:
            header_list = self.api_client.select_header_content_type(
                content_type_headers_list)
            params['header']['Content-Type'] = header_list

        return self.api_client.call_api(
            self.settings['endpoint_path'], self.settings['http_method'],
            params['path'],
            params['query'],
            params['header'],
            body=params['body'],
            post_params=params['form'],
            files=params['file'],
            response_type=self.settings['response_type'],
            auth_settings=self.settings['auth'],
            async_req=kwargs['async_req'],
            _check_type=kwargs['_check_return_type'],
            _return_http_data_only=kwargs['_return_http_data_only'],
            _preload_content=kwargs['_preload_content'],
            _request_timeout=kwargs['_request_timeout'],
            _host=_host,
            collection_formats=params['collection_format'])
Пример #19
0
    def contact_search_contact_with_http_info(self, query,
                                              **kwargs):  # noqa: E501
        """Filter for contacts - Deprecated  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.contact_search_contact_with_http_info(query, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param ContactBindingModel query: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['query']
        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 contact_search_contact" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'query' is set
        if self.api_client.client_side_validation and (
                'query' not in local_var_params or  # noqa: E501
                local_var_params['query'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `query` when calling `contact_search_contact`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'query' in local_var_params:
            body_params = local_var_params['query']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/json', 'application/xml',
             'text/xml'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            'Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
                [
                    'application/json', 'text/json', 'application/xml',
                    'text/xml', 'application/x-www-form-urlencoded'
                ])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/contacts/search',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  # 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)
Пример #20
0
    def post_upload_project_with_http_info(self, **kwargs):  # noqa: E501
        """Uploads a NeoLoad project zip file or a standalone as code file  # noqa: E501

        Uploads a NeoLoad project of the account corresponding to the parameters. The maximum size file is 250 MB  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_upload_project_with_http_info(async_req=True)
        >>> result = thread.get()

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

        local_var_hosts = [__import__('neoload').getCurrentFilesUrl()
                           ]  # noqa: E501
        local_var_host = local_var_hosts[0]
        if kwargs.get('_host_index'):
            if int(kwags.get('_host_index')) < 0 or int(
                    kawgs.get('_host_index')) >= len(local_var_hosts):
                raise ApiValueError(
                    "Invalid host index. Must be 0 <= index < %s" %
                    len(local_var_host))
            local_var_host = local_var_hosts[int(kwargs.get('_host_index'))]
        local_var_params = locals()

        all_params = ['file']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params and key != "_host_index":
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method post_upload_project" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'file' in local_var_params:
            local_var_files['file'] = local_var_params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            'Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
                ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['NeoloadAuthorizer']  # noqa: E501

        return self.api_client.call_api(
            '/projects',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ProjectDefinition',  # 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'),
            _host=local_var_host,
            collection_formats=collection_formats)
Пример #21
0
    def activity_processes_get_activity_process_id_from_ref_and_res_with_http_info(
            self, companyid, model, **kwargs):  # noqa: E501
        """Get activity process id.  # noqa: E501

        This endpoint returns and activity process id for a given               reference id and result id. The reference id can be null if one doesn't              exist. Result id is required.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.activity_processes_get_activity_process_id_from_ref_and_res_with_http_info(companyid, model, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str companyid: (required)
        :param ReferenceAndResultBindingModel model: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['companyid', 'model']
        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 activity_processes_get_activity_process_id_from_ref_and_res"
                    % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'companyid' is set
        if self.api_client.client_side_validation and (
                'companyid' not in local_var_params or  # noqa: E501
                local_var_params['companyid'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `companyid` when calling `activity_processes_get_activity_process_id_from_ref_and_res`"
            )  # noqa: E501
        # verify the required parameter 'model' is set
        if self.api_client.client_side_validation and (
                'model' not in local_var_params or  # noqa: E501
                local_var_params['model'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `model` when calling `activity_processes_get_activity_process_id_from_ref_and_res`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'companyid' in local_var_params:
            path_params['companyid'] = local_var_params[
                'companyid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'model' in local_var_params:
            body_params = local_var_params['model']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/json', 'application/xml',
             'text/xml'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            'Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
                [
                    'application/json', 'text/json', 'application/xml',
                    'text/xml', 'application/x-www-form-urlencoded'
                ])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/companies/{companyid}/activitityprocessid',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  # 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)
Пример #22
0
    def get_tests_run_with_http_info(self, name, project_id, scenario_name,
                                     **kwargs):  # noqa: E501
        """Runs a test  # noqa: E501

        Runs a test of the Account according to the method parameters.  # 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_tests_run_with_http_info(name, project_id, scenario_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str name: The name of the test (required)
        :param str project_id: The project Id of the test (required)
        :param str scenario_name: The scenario name of the test (required)
        :param str description: The description of the test
        :param str as_code: The comma-separated as-code files to use for the test. Those files must be part of the uploaded project.
        :param str reservation_id: The reservation identifier to use for the test that can be retrieved from the NeoLoad Web reservation calendar URL. If the reservation mode is enabled and \"reservationId\" value is defined, \"reservationDuration\", \"reservationWebVUs\" and \"reservationSAPVUs\" values will be ignored, otherwise if the reservation mode is disabled the value will be ignored.
        :param int reservation_duration: The duration of the reservation for the test. If the reservation mode is enabled, this value or \"reservationDuration\", \"reservationWebVUs\", \"reservationSAPVUs\" must be defined, otherwise if the reservation mode is disabled the value will be ignored. The value (in seconds) is optional when the reservation mode is enabled and ignored when reservationId value is defined or if the reservation mode is disabled. The default value is the selected scenario duration + 1200 seconds (20 minutes). All reserved resources will be released when the test ends.
        :param int reservation_web_v_us: The number of Web Virtual Users to be reserved for the test. The value is optional when the reservation mode is enabled and ignored when \"reservationId\" value is defined or if the reservation mode is disabled.
        :param int reservation_sapv_us: The number of SAP Virtual Users to be reserved for the test. The value is optional when the reservation mode is enabled and ignored when \"reservationId\" value is defined or if the reservation mode is disabled.
        :param str controller_zone_id: The controller zone Id. If empty, the default zone will be used.
        :param str lg_zones: The LG zones with the number of the LGs. Example: \"ZoneId1:10,ZoneId2:5\". If empty, the default zone will be used with one LG.
        :param bool publish_test_result: When \"true\" and the project is an collaborative project (other than git) then the test result is published onto the server. If empty, the default value is \"false\".
        :param bool delete_project_after_test: When \"true\" deletes associated test as soon as test result is created. If empty, the default value is \"false\".
        :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(RunTestDefinition, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'name', 'project_id', 'scenario_name', 'description', 'as_code',
            'reservation_id', 'reservation_duration', 'reservation_web_v_us',
            'reservation_sapv_us', 'controller_zone_id', 'lg_zones',
            'publish_test_result', 'delete_project_after_test'
        ]  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method get_tests_run" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'name' is set
        if self.api_client.client_side_validation and (
                'name' not in local_var_params or  # noqa: E501
                local_var_params['name'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `name` when calling `get_tests_run`"
            )  # noqa: E501
        # verify the required parameter 'project_id' is set
        if self.api_client.client_side_validation and (
                'project_id' not in local_var_params or  # noqa: E501
                local_var_params['project_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `project_id` when calling `get_tests_run`"
            )  # noqa: E501
        # verify the required parameter 'scenario_name' is set
        if self.api_client.client_side_validation and (
                'scenario_name' not in local_var_params or  # noqa: E501
                local_var_params['scenario_name'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `scenario_name` when calling `get_tests_run`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'project_id' in local_var_params:
            path_params['projectId'] = local_var_params[
                'project_id']  # noqa: E501

        query_params = []
        if 'name' in local_var_params and local_var_params[
                'name'] is not None:  # noqa: E501
            query_params.append(
                ('name', local_var_params['name']))  # noqa: E501
        if 'description' in local_var_params and local_var_params[
                'description'] is not None:  # noqa: E501
            query_params.append(
                ('description', local_var_params['description']))  # noqa: E501
        if 'as_code' in local_var_params and local_var_params[
                'as_code'] is not None:  # noqa: E501
            query_params.append(
                ('asCode', local_var_params['as_code']))  # noqa: E501
        if 'scenario_name' in local_var_params and local_var_params[
                'scenario_name'] is not None:  # noqa: E501
            query_params.append(
                ('scenarioName',
                 local_var_params['scenario_name']))  # noqa: E501
        if 'reservation_id' in local_var_params and local_var_params[
                'reservation_id'] is not None:  # noqa: E501
            query_params.append(
                ('reservationId',
                 local_var_params['reservation_id']))  # noqa: E501
        if 'reservation_duration' in local_var_params and local_var_params[
                'reservation_duration'] is not None:  # noqa: E501
            query_params.append(
                ('reservationDuration',
                 local_var_params['reservation_duration']))  # noqa: E501
        if 'reservation_web_v_us' in local_var_params and local_var_params[
                'reservation_web_v_us'] is not None:  # noqa: E501
            query_params.append(
                ('reservationWebVUs',
                 local_var_params['reservation_web_v_us']))  # noqa: E501
        if 'reservation_sapv_us' in local_var_params and local_var_params[
                'reservation_sapv_us'] is not None:  # noqa: E501
            query_params.append(
                ('reservationSAPVUs',
                 local_var_params['reservation_sapv_us']))  # noqa: E501
        if 'controller_zone_id' in local_var_params and local_var_params[
                'controller_zone_id'] is not None:  # noqa: E501
            query_params.append(
                ('controllerZoneId',
                 local_var_params['controller_zone_id']))  # noqa: E501
        if 'lg_zones' in local_var_params and local_var_params[
                'lg_zones'] is not None:  # noqa: E501
            query_params.append(
                ('lgZones', local_var_params['lg_zones']))  # noqa: E501
        if 'publish_test_result' in local_var_params and local_var_params[
                'publish_test_result'] is not None:  # noqa: E501
            query_params.append(
                ('publishTestResult',
                 local_var_params['publish_test_result']))  # noqa: E501
        if 'delete_project_after_test' in local_var_params and local_var_params[
                'delete_project_after_test'] is not None:  # noqa: E501
            query_params.append(
                ('deleteProjectAfterTest',
                 local_var_params['delete_project_after_test']))  # 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 = ['NeoloadAuthorizer']  # noqa: E501

        return self.api_client.call_api(
            '/projects/{projectId}/run',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunTestDefinition',  # 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)
Пример #23
0
    def get_bank_accounts_with_http_info(self, **kwargs):  # noqa: E501
        """Returns all Bank Accounts  # noqa: E501

        Returns all Bank Accounts  ### Endpoint Availability  * Accounting: 🇨🇦, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸 * Accounting Start: 🇨🇦, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸  ### Access Control Restrictions  Requires the authenticated user to have any of the following roles in the area `Bank`: Full Access, Read Only, Restricted Access  # 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_bank_accounts_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param datetime updated_or_created_since: Use this to limit the response to Bank Accounts changed since a given date (format: YYYY-MM-DDT(+|-)hh:mm) or date-time (format: YYYY-MM-DDThh:mm:ss(+|-)hh:mm). Inclusive of the passed timestamp.
        :param datetime deleted_since: Use this to limit the response to Bank Accounts deleted since a given date (format: YYYY-MM-DDT(+|-)hh:mm) or date-time (format: YYYY-MM-DDThh:mm:ss(+|-)hh:mm). Not inclusive of the passed timestamp.
        :param str nested_attributes: Specify the attributes that you want to expose for nested entities of the Bank Accounts (expose all nested attributes with 'all'). These are in addition to the base attributes (name, path)
        :param bool exclude_stripe: Use this to filter out Stripe Bank Accounts
        :param bool show_legacy_id: Display the legacy_id for the Bank Accounts.
        :param int items_per_page: Returns the given number of Bank Accounts per request.
        :param int page: Go to specific page of Bank Accounts
        :param str attributes: Specify the attributes that you want to expose for the Bank Accounts (expose all attributes with 'all'). These are in addition to the base attributes (name, path)
        :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(list[BankAccount], status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['updated_or_created_since', 'deleted_since', 'nested_attributes', 'exclude_stripe', 'show_legacy_id', 'items_per_page', 'page', 'attributes']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_bank_accounts" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        if self.api_client.client_side_validation and 'items_per_page' in local_var_params and local_var_params['items_per_page'] > 200:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `items_per_page` when calling `get_bank_accounts`, must be a value less than or equal to `200`")  # noqa: E501
        if self.api_client.client_side_validation and 'items_per_page' in local_var_params and local_var_params['items_per_page'] < 1:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `items_per_page` when calling `get_bank_accounts`, must be a value greater than or equal to `1`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'updated_or_created_since' in local_var_params and local_var_params['updated_or_created_since'] is not None:  # noqa: E501
            query_params.append(('updated_or_created_since', local_var_params['updated_or_created_since']))  # noqa: E501
        if 'deleted_since' in local_var_params and local_var_params['deleted_since'] is not None:  # noqa: E501
            query_params.append(('deleted_since', local_var_params['deleted_since']))  # noqa: E501
        if 'nested_attributes' in local_var_params and local_var_params['nested_attributes'] is not None:  # noqa: E501
            query_params.append(('nested_attributes', local_var_params['nested_attributes']))  # noqa: E501
        if 'exclude_stripe' in local_var_params and local_var_params['exclude_stripe'] is not None:  # noqa: E501
            query_params.append(('exclude_stripe', local_var_params['exclude_stripe']))  # noqa: E501
        if 'show_legacy_id' in local_var_params and local_var_params['show_legacy_id'] is not None:  # noqa: E501
            query_params.append(('show_legacy_id', local_var_params['show_legacy_id']))  # noqa: E501
        if 'items_per_page' in local_var_params and local_var_params['items_per_page'] is not None:  # noqa: E501
            query_params.append(('items_per_page', local_var_params['items_per_page']))  # noqa: E501
        if 'page' in local_var_params and local_var_params['page'] is not None:  # noqa: E501
            query_params.append(('page', local_var_params['page']))  # noqa: E501
        if 'attributes' in local_var_params and local_var_params['attributes'] is not None:  # noqa: E501
            query_params.append(('attributes', local_var_params['attributes']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/bank_accounts', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[BankAccount]',  # 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_zakelijk_gerechtigde_with_http_info(
            self, kadastraalonroerendezaakidentificatie,
            zakelijkgerechtigdeidentificatie, **kwargs):  # noqa: E501
        """get_zakelijk_gerechtigde  # noqa: E501

        Het raadplegen van een specifieke zakelijk gerechtigde van een kadastraal onroerende zaak. Het aandeel van de zakelijk gerechtigde wordt altijd geleverd in combinatie met het gezamenlijk aandeel (wanneer twee of meer personen een gezamenlijk aandeel hebben in een zakelijk recht, en ieders afzonderlijke aandeel in het gezamenlijk aandeel niet bekend is)  # 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_zakelijk_gerechtigde_with_http_info(kadastraalonroerendezaakidentificatie, zakelijkgerechtigdeidentificatie, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str kadastraalonroerendezaakidentificatie: De unieke identificatie van een kadastraal onroerende zaak. (required)
        :param str zakelijkgerechtigdeidentificatie: De identificatie van de zakelijk gerechtigde (required)
        :param str fields: Hiermee kun je de inhoud van de resource naar behoefte aanpassen door een door komma's gescheiden lijst van property namen op te geven. Bij opgave van niet-bestaande properties wordt een 400 Bad Request teruggegeven. Wanneer de fields parameter niet is opgegeven, worden alle properties met een waarde teruggegeven. Zie [functionele specificaties](https://github.com/VNG-Realisatie/Haal-Centraal-common/blob/v1.0.0/features/fields.feature)
        :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(ZakelijkGerechtigdeHal, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'kadastraalonroerendezaakidentificatie',
            'zakelijkgerechtigdeidentificatie', 'fields'
        ]
        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_zakelijk_gerechtigde" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'kadastraalonroerendezaakidentificatie' is set
        if self.api_client.client_side_validation and (
                'kadastraalonroerendezaakidentificatie' not in local_var_params
                or  # noqa: E501
                local_var_params['kadastraalonroerendezaakidentificatie'] is
                None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `kadastraalonroerendezaakidentificatie` when calling `get_zakelijk_gerechtigde`"
            )  # noqa: E501
        # verify the required parameter 'zakelijkgerechtigdeidentificatie' is set
        if self.api_client.client_side_validation and (
                'zakelijkgerechtigdeidentificatie' not in local_var_params
                or  # noqa: E501
                local_var_params['zakelijkgerechtigdeidentificatie'] is None
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `zakelijkgerechtigdeidentificatie` when calling `get_zakelijk_gerechtigde`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'kadastraalonroerendezaakidentificatie' in local_var_params:
            path_params[
                'kadastraalonroerendezaakidentificatie'] = local_var_params[
                    'kadastraalonroerendezaakidentificatie']  # noqa: E501
        if 'zakelijkgerechtigdeidentificatie' in local_var_params:
            path_params['zakelijkgerechtigdeidentificatie'] = local_var_params[
                'zakelijkgerechtigdeidentificatie']  # noqa: E501

        query_params = []
        if 'fields' in local_var_params and local_var_params[
                'fields'] is not None:  # noqa: E501
            query_params.append(
                ('fields', local_var_params['fields']))  # 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/hal+json', 'application/problem+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['apiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/kadastraalonroerendezaken/{kadastraalonroerendezaakidentificatie}/zakelijkgerechtigden/{zakelijkgerechtigdeidentificatie}',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ZakelijkGerechtigdeHal',  # 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)
Пример #25
0
    def delete_bank_accounts_key_with_http_info(self, key, **kwargs):  # noqa: E501
        """Deletes a Bank Account  # noqa: E501

        Deletes a Bank Account  ### Endpoint Availability  * Accounting: 🇨🇦, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸 * Accounting Start: 🇨🇦, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸  ### Access Control Restrictions  Requires the authenticated user to have any of the following roles in the area `Bank`: Full Access  # 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_bank_accounts_key_with_http_info(key, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str key: The Bank Account Key. (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 = ['key']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_bank_accounts_key" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and ('key' not in local_var_params or  # noqa: E501
                                                        local_var_params['key'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `key` when calling `delete_bank_accounts_key`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'key' in local_var_params:
            path_params['key'] = local_var_params['key']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/bank_accounts/{key}', '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)
Пример #26
0
    def inpy_versions_update_with_http_info(self, id, data,
                                            **kwargs):  # noqa: E501
        """inpy_versions_update  # noqa: E501

        Inpy is the service for preparing models to become usable by the Threedi calculation core. Updates in Inpy often result in updates in the calculation core.  This resource keeps track of updates to the Inpy service.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.inpy_versions_update_with_http_info(id, data, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int id: A unique integer value identifying this inpy version. (required)
        :param InpyVersion data: (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(InpyVersion, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['id', '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 inpy_versions_update" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and (
                'id' not in local_var_params or  # noqa: E501
                local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `id` when calling `inpy_versions_update`"
            )  # noqa: E501
        # verify the required parameter 'data' is set
        if self.api_client.client_side_validation and (
                'data' not in local_var_params or  # noqa: E501
                local_var_params['data'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `data` when calling `inpy_versions_update`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in local_var_params:
            path_params['id'] = local_var_params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        return self.api_client.call_api(
            '/inpy-versions/{id}/',
            'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InpyVersion',  # 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)
Пример #27
0
    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)):
                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':
                    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 put_sales_credit_notes_key_with_http_info(self, key,
                                                  sales_credit_notes,
                                                  **kwargs):  # noqa: E501
        """Updates a Sales Credit Note  # noqa: E501

        Updates a Sales Credit Note  ### Endpoint Availability  * Accounting: 🇨🇦, 🇩🇪, 🇫🇷, 🇮🇪, 🇬🇧, 🇺🇸  ### Access Control Restrictions  Requires the authenticated user to have any of the following roles in the area `Sales`: Full Access, Restricted Access  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_sales_credit_notes_key_with_http_info(key, sales_credit_notes, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str key: The Sales Credit Note Key. (required)
        :param PutSalesCreditNotes sales_credit_notes: (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(SalesCreditNote, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['key', 'sales_credit_notes']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method put_sales_credit_notes_key" %
                                   key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and (
                'key' not in local_var_params or  # noqa: E501
                local_var_params['key'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `key` when calling `put_sales_credit_notes_key`"
            )  # noqa: E501
        # verify the required parameter 'sales_credit_notes' is set
        if self.api_client.client_side_validation and (
                'sales_credit_notes' not in local_var_params or  # noqa: E501
                local_var_params['sales_credit_notes'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `sales_credit_notes` when calling `put_sales_credit_notes_key`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'key' in local_var_params:
            path_params['key'] = local_var_params['key']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'sales_credit_notes' in local_var_params:
            body_params = local_var_params['sales_credit_notes']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            'Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
                ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/sales_credit_notes/{key}',
            'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SalesCreditNote',  # 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)
Пример #29
0
    def list_content_by_search_with_http_info(self, **kwargs):  # noqa: E501
        """Get a list of Contents by searching  # 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_content_by_search_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int page: Page number within the paginated result set.
        :param int page_size: Number of results to return per page.
        :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(ContentsPage, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['page', 'page_size']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method list_content_by_search" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        if '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_content_by_search`, must be a value less than or equal to `1000`"
            )  # noqa: E501
        if '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_content_by_search`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'page' in local_var_params:
            query_params.append(
                ('page', local_var_params['page']))  # noqa: E501
        if 'page_size' in local_var_params:
            query_params.append(
                ('page_size', local_var_params['page_size']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/search/content/',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ContentsPage',  # 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)
Пример #30
0
    def api_web_route_controller_show_with_http_info(self, id, **kwargs):  # noqa: E501
        """api_web_route_controller_show  # noqa: E501

        Show a particular route by the route's id.  ## Names and Descriptions  There are 3 attributes with increasing details for naming and describing the route.  1. `/data/attributes/short_name` 2. `/data/attributes/long_name` 3. `/data/attributes/description`  ## Directions  `/data/attributes/direction_names` is the only place to convert the `direction_id` used throughout the rest of the API to human-readable names.  ## Type  `/data/attributes/type` corresponds to [GTFS `routes.txt` `route_type`](https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md#routestxt).  | Value | Name          | Example    | |-------|---------------|------------| | `0`   | Light Rail    | Green Line | | `1`   | Heavy Rail    | Red Line   | | `2`   | Commuter Rail |            | | `3`   | Bus           |            | | `4`   | Ferry         |            |     # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_web_route_controller_show_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str id: Unique identifier for route (required)
        :param str fields_route: Fields to include with the response. Multiple fields **MUST** be a comma-separated (U+002C COMMA, \",\") list.  Note that fields can also be selected for included data types: see the [V3 API Best Practices](https://www.mbta.com/developers/v3-api/best-practices) for an example. 
        :param str include: Relationships to include.  * `line` * `route_patterns`  The value of the include parameter **MUST** be a comma-separated (U+002C COMMA, \",\") list of relationship paths. A relationship path is a dot-separated (U+002E FULL-STOP, \".\") list of relationship names. [JSONAPI \"include\" behavior](http://jsonapi.org/format/#fetching-includes)   
        :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(Route, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['id', 'fields_route', 'include']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_web_route_controller_show" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                        local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `id` when calling `api_web_route_controller_show`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in local_var_params:
            path_params['id'] = local_var_params['id']  # noqa: E501

        query_params = []
        if 'fields_route' in local_var_params and local_var_params['fields_route'] is not None:  # noqa: E501
            query_params.append(('fields[route]', local_var_params['fields_route']))  # 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/vnd.api+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key_in_header', 'api_key_in_query']  # noqa: E501

        return self.api_client.call_api(
            '/routes/{id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Route',  # 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)