# coding: utf-8

"""
    Metacore IOT Object Storage API

    Metacore IOT Core Services  # noqa: E501

    The version of the OpenAPI document: 0.2
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from metacore_obs_api.api_client import ApiClient
from metacore_obs_api.exceptions import (
    ApiTypeError,
    ApiValueError
)


class RolesApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def getroles(self, **kwargs):  # noqa: E501
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {\"number\": 10})
        :param str sort: the sort query parameter (ex.: \"city,-lastname\")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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: InlineResponse20011
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_with_http_info(**kwargs)  # noqa: E501

    def getroles_with_http_info(self, **kwargs):  # noqa: E501
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {\"number\": 10})
        :param str sort: the sort query parameter (ex.: \"city,-lastname\")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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(InlineResponse20011, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['where', 'sort', 'page', 'max_results']  # 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 getroles" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

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

        return self.api_client.call_api(
            '/roles', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20011',  # 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 getroles_item(self, roles_id, **kwargs):  # noqa: E501
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :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: Roles
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_item_with_http_info(roles_id, **kwargs)  # noqa: E501

    def getroles_item_with_http_info(self, roles_id, **kwargs):  # noqa: E501
        """Retrieves a roles document  # noqa: E501

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

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

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_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 = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']  # noqa: E501

        return self.api_client.call_api(
            '/roles/{rolesId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Roles',  # 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 patchroles_item(self, roles_id, if_match, roles, **kwargs):  # noqa: E501
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.patchroles_item_with_http_info(roles_id, if_match, roles, **kwargs)  # noqa: E501

    def patchroles_item_with_http_info(self, roles_id, if_match, roles, **kwargs):  # noqa: E501
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']  # 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 patchroles_item" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'roles_id' is set
        if ('roles_id' not in local_var_params or
                local_var_params['roles_id'] is None):
            raise ApiValueError("Missing the required parameter `roles_id` when calling `patchroles_item`")  # noqa: E501
        # verify the required parameter 'if_match' is set
        if ('if_match' not in local_var_params or
                local_var_params['if_match'] is None):
            raise ApiValueError("Missing the required parameter `if_match` when calling `patchroles_item`")  # noqa: E501
        # verify the required parameter 'roles' is set
        if ('roles' not in local_var_params or
                local_var_params['roles'] is None):
            raise ApiValueError("Missing the required parameter `roles` when calling `patchroles_item`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        # 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 = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']  # noqa: E501

        return self.api_client.call_api(
            '/roles/{rolesId}', '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)

    def postroles(self, roles, **kwargs):  # noqa: E501
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.postroles_with_http_info(roles, **kwargs)  # noqa: E501

    def postroles_with_http_info(self, roles, **kwargs):  # noqa: E501
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (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 = ['roles']  # 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 postroles" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'roles' is set
        if ('roles' not in local_var_params or
                local_var_params['roles'] is None):
            raise ApiValueError("Missing the required parameter `roles` when calling `postroles`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        # 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 = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']  # noqa: E501

        return self.api_client.call_api(
            '/roles', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def putroles_item(self, roles_id, if_match, roles, **kwargs):  # noqa: E501
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.putroles_item_with_http_info(roles_id, if_match, roles, **kwargs)  # noqa: E501

    def putroles_item_with_http_info(self, roles_id, if_match, roles, **kwargs):  # noqa: E501
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']  # 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 putroles_item" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'roles_id' is set
        if ('roles_id' not in local_var_params or
                local_var_params['roles_id'] is None):
            raise ApiValueError("Missing the required parameter `roles_id` when calling `putroles_item`")  # noqa: E501
        # verify the required parameter 'if_match' is set
        if ('if_match' not in local_var_params or
                local_var_params['if_match'] is None):
            raise ApiValueError("Missing the required parameter `if_match` when calling `putroles_item`")  # noqa: E501
        # verify the required parameter 'roles' is set
        if ('roles' not in local_var_params or
                local_var_params['roles'] is None):
            raise ApiValueError("Missing the required parameter `roles` when calling `putroles_item`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        # 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 = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']  # noqa: E501

        return self.api_client.call_api(
            '/roles/{rolesId}', 'PUT',
            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)

27ecfbd1d07c5a27e2c85d502aa24bd8d3ecd527
<mask token>


class RolesApi(object):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def getroles_item(self, roles_id, **kwargs):
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :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: Roles
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_item_with_http_info(roles_id, **kwargs)

    def getroles_item_with_http_info(self, roles_id, **kwargs):
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_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(Roles, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """
        local_var_params = locals()
        all_params = ['roles_id']
        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 getroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `getroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'GET',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            'Roles', auth_settings=auth_settings, async_req=
            local_var_params.get('async_req'), _return_http_data_only=
            local_var_params.get('_return_http_data_only'),
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
    <mask token>
    <mask token>
    <mask token>

    def postroles_with_http_info(self, roles, **kwargs):
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (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 = ['roles']
        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 postroles"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `postroles`'
                )
        collection_formats = {}
        path_params = {}
        query_params = []
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles', 'POST', path_params,
            query_params, header_params, body=body_params, post_params=
            form_params, files=local_var_files, response_type=None,
            auth_settings=auth_settings, async_req=local_var_params.get(
            'async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)
    <mask token>
    <mask token>

<mask token>


class RolesApi(object):
    <mask token>

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def getroles(self, **kwargs):
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {"number": 10})
        :param str sort: the sort query parameter (ex.: "city,-lastname")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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: InlineResponse20011
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_with_http_info(**kwargs)

    def getroles_with_http_info(self, **kwargs):
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {"number": 10})
        :param str sort: the sort query parameter (ex.: "city,-lastname")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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(InlineResponse20011, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """
        local_var_params = locals()
        all_params = ['where', 'sort', 'page', 'max_results']
        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 getroles"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        collection_formats = {}
        path_params = {}
        query_params = []
        if 'where' in local_var_params:
            query_params.append(('where', local_var_params['where']))
        if 'sort' in local_var_params:
            query_params.append(('sort', local_var_params['sort']))
        if 'page' in local_var_params:
            query_params.append(('page', local_var_params['page']))
        if 'max_results' in local_var_params:
            query_params.append(('max_results', local_var_params[
                'max_results']))
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles', 'GET', path_params,
            query_params, header_params, body=body_params, post_params=
            form_params, files=local_var_files, response_type=
            'InlineResponse20011', auth_settings=auth_settings, async_req=
            local_var_params.get('async_req'), _return_http_data_only=
            local_var_params.get('_return_http_data_only'),
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def getroles_item(self, roles_id, **kwargs):
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :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: Roles
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_item_with_http_info(roles_id, **kwargs)

    def getroles_item_with_http_info(self, roles_id, **kwargs):
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_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(Roles, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """
        local_var_params = locals()
        all_params = ['roles_id']
        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 getroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `getroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'GET',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            'Roles', auth_settings=auth_settings, async_req=
            local_var_params.get('async_req'), _return_http_data_only=
            local_var_params.get('_return_http_data_only'),
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patchroles_item(self, roles_id, if_match, roles, **kwargs):
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.patchroles_item_with_http_info(roles_id, if_match,
            roles, **kwargs)

    def patchroles_item_with_http_info(self, roles_id, if_match, roles, **
        kwargs):
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']
        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 patchroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `patchroles_item`'
                )
        if 'if_match' not in local_var_params or local_var_params['if_match'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `if_match` when calling `patchroles_item`'
                )
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `patchroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'PATCH',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            None, auth_settings=auth_settings, async_req=local_var_params.
            get('async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

    def postroles(self, roles, **kwargs):
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.postroles_with_http_info(roles, **kwargs)

    def postroles_with_http_info(self, roles, **kwargs):
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (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 = ['roles']
        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 postroles"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `postroles`'
                )
        collection_formats = {}
        path_params = {}
        query_params = []
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles', 'POST', path_params,
            query_params, header_params, body=body_params, post_params=
            form_params, files=local_var_files, response_type=None,
            auth_settings=auth_settings, async_req=local_var_params.get(
            'async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

    def putroles_item(self, roles_id, if_match, roles, **kwargs):
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.putroles_item_with_http_info(roles_id, if_match, roles,
            **kwargs)

    def putroles_item_with_http_info(self, roles_id, if_match, roles, **kwargs
        ):
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']
        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 putroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `putroles_item`'
                )
        if 'if_match' not in local_var_params or local_var_params['if_match'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `if_match` when calling `putroles_item`'
                )
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `putroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'PUT',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            None, auth_settings=auth_settings, async_req=local_var_params.
            get('async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

<mask token>


class RolesApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def getroles(self, **kwargs):
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {"number": 10})
        :param str sort: the sort query parameter (ex.: "city,-lastname")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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: InlineResponse20011
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_with_http_info(**kwargs)

    def getroles_with_http_info(self, **kwargs):
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {"number": 10})
        :param str sort: the sort query parameter (ex.: "city,-lastname")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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(InlineResponse20011, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """
        local_var_params = locals()
        all_params = ['where', 'sort', 'page', 'max_results']
        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 getroles"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        collection_formats = {}
        path_params = {}
        query_params = []
        if 'where' in local_var_params:
            query_params.append(('where', local_var_params['where']))
        if 'sort' in local_var_params:
            query_params.append(('sort', local_var_params['sort']))
        if 'page' in local_var_params:
            query_params.append(('page', local_var_params['page']))
        if 'max_results' in local_var_params:
            query_params.append(('max_results', local_var_params[
                'max_results']))
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles', 'GET', path_params,
            query_params, header_params, body=body_params, post_params=
            form_params, files=local_var_files, response_type=
            'InlineResponse20011', auth_settings=auth_settings, async_req=
            local_var_params.get('async_req'), _return_http_data_only=
            local_var_params.get('_return_http_data_only'),
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def getroles_item(self, roles_id, **kwargs):
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :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: Roles
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_item_with_http_info(roles_id, **kwargs)

    def getroles_item_with_http_info(self, roles_id, **kwargs):
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_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(Roles, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """
        local_var_params = locals()
        all_params = ['roles_id']
        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 getroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `getroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'GET',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            'Roles', auth_settings=auth_settings, async_req=
            local_var_params.get('async_req'), _return_http_data_only=
            local_var_params.get('_return_http_data_only'),
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patchroles_item(self, roles_id, if_match, roles, **kwargs):
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.patchroles_item_with_http_info(roles_id, if_match,
            roles, **kwargs)

    def patchroles_item_with_http_info(self, roles_id, if_match, roles, **
        kwargs):
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']
        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 patchroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `patchroles_item`'
                )
        if 'if_match' not in local_var_params or local_var_params['if_match'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `if_match` when calling `patchroles_item`'
                )
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `patchroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'PATCH',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            None, auth_settings=auth_settings, async_req=local_var_params.
            get('async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

    def postroles(self, roles, **kwargs):
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.postroles_with_http_info(roles, **kwargs)

    def postroles_with_http_info(self, roles, **kwargs):
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (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 = ['roles']
        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 postroles"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `postroles`'
                )
        collection_formats = {}
        path_params = {}
        query_params = []
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles', 'POST', path_params,
            query_params, header_params, body=body_params, post_params=
            form_params, files=local_var_files, response_type=None,
            auth_settings=auth_settings, async_req=local_var_params.get(
            'async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

    def putroles_item(self, roles_id, if_match, roles, **kwargs):
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.putroles_item_with_http_info(roles_id, if_match, roles,
            **kwargs)

    def putroles_item_with_http_info(self, roles_id, if_match, roles, **kwargs
        ):
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']
        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 putroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `putroles_item`'
                )
        if 'if_match' not in local_var_params or local_var_params['if_match'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `if_match` when calling `putroles_item`'
                )
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `putroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'PUT',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            None, auth_settings=auth_settings, async_req=local_var_params.
            get('async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

<mask token>
from __future__ import absolute_import
import re
import six
from metacore_obs_api.api_client import ApiClient
from metacore_obs_api.exceptions import ApiTypeError, ApiValueError


class RolesApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def getroles(self, **kwargs):
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {"number": 10})
        :param str sort: the sort query parameter (ex.: "city,-lastname")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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: InlineResponse20011
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_with_http_info(**kwargs)

    def getroles_with_http_info(self, **kwargs):
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {"number": 10})
        :param str sort: the sort query parameter (ex.: "city,-lastname")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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(InlineResponse20011, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """
        local_var_params = locals()
        all_params = ['where', 'sort', 'page', 'max_results']
        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 getroles"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        collection_formats = {}
        path_params = {}
        query_params = []
        if 'where' in local_var_params:
            query_params.append(('where', local_var_params['where']))
        if 'sort' in local_var_params:
            query_params.append(('sort', local_var_params['sort']))
        if 'page' in local_var_params:
            query_params.append(('page', local_var_params['page']))
        if 'max_results' in local_var_params:
            query_params.append(('max_results', local_var_params[
                'max_results']))
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles', 'GET', path_params,
            query_params, header_params, body=body_params, post_params=
            form_params, files=local_var_files, response_type=
            'InlineResponse20011', auth_settings=auth_settings, async_req=
            local_var_params.get('async_req'), _return_http_data_only=
            local_var_params.get('_return_http_data_only'),
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def getroles_item(self, roles_id, **kwargs):
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :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: Roles
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_item_with_http_info(roles_id, **kwargs)

    def getroles_item_with_http_info(self, roles_id, **kwargs):
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_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(Roles, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """
        local_var_params = locals()
        all_params = ['roles_id']
        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 getroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `getroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'GET',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            'Roles', auth_settings=auth_settings, async_req=
            local_var_params.get('async_req'), _return_http_data_only=
            local_var_params.get('_return_http_data_only'),
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patchroles_item(self, roles_id, if_match, roles, **kwargs):
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.patchroles_item_with_http_info(roles_id, if_match,
            roles, **kwargs)

    def patchroles_item_with_http_info(self, roles_id, if_match, roles, **
        kwargs):
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']
        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 patchroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `patchroles_item`'
                )
        if 'if_match' not in local_var_params or local_var_params['if_match'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `if_match` when calling `patchroles_item`'
                )
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `patchroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'PATCH',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            None, auth_settings=auth_settings, async_req=local_var_params.
            get('async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

    def postroles(self, roles, **kwargs):
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.postroles_with_http_info(roles, **kwargs)

    def postroles_with_http_info(self, roles, **kwargs):
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (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 = ['roles']
        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 postroles"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `postroles`'
                )
        collection_formats = {}
        path_params = {}
        query_params = []
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles', 'POST', path_params,
            query_params, header_params, body=body_params, post_params=
            form_params, files=local_var_files, response_type=None,
            auth_settings=auth_settings, async_req=local_var_params.get(
            'async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

    def putroles_item(self, roles_id, if_match, roles, **kwargs):
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.putroles_item_with_http_info(roles_id, if_match, roles,
            **kwargs)

    def putroles_item_with_http_info(self, roles_id, if_match, roles, **kwargs
        ):
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']
        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 putroles_item"
                     % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        if 'roles_id' not in local_var_params or local_var_params['roles_id'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles_id` when calling `putroles_item`'
                )
        if 'if_match' not in local_var_params or local_var_params['if_match'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `if_match` when calling `putroles_item`'
                )
        if 'roles' not in local_var_params or local_var_params['roles'
            ] is None:
            raise ApiValueError(
                'Missing the required parameter `roles` when calling `putroles_item`'
                )
        collection_formats = {}
        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_id']
        query_params = []
        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']
        form_params = []
        local_var_files = {}
        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        header_params['Accept'] = self.api_client.select_header_accept([
            'application/json'])
        header_params['Content-Type'
            ] = self.api_client.select_header_content_type(['application/json']
            )
        auth_settings = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']
        return self.api_client.call_api('/roles/{rolesId}', 'PUT',
            path_params, query_params, header_params, body=body_params,
            post_params=form_params, files=local_var_files, response_type=
            None, auth_settings=auth_settings, async_req=local_var_params.
            get('async_req'), _return_http_data_only=local_var_params.get(
            '_return_http_data_only'), _preload_content=local_var_params.
            get('_preload_content', True), _request_timeout=
            local_var_params.get('_request_timeout'), collection_formats=
            collection_formats)

# coding: utf-8

"""
    Metacore IOT Object Storage API

    Metacore IOT Core Services  # noqa: E501

    The version of the OpenAPI document: 0.2
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from metacore_obs_api.api_client import ApiClient
from metacore_obs_api.exceptions import (
    ApiTypeError,
    ApiValueError
)


class RolesApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def getroles(self, **kwargs):  # noqa: E501
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {\"number\": 10})
        :param str sort: the sort query parameter (ex.: \"city,-lastname\")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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: InlineResponse20011
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_with_http_info(**kwargs)  # noqa: E501

    def getroles_with_http_info(self, **kwargs):  # noqa: E501
        """Retrieves one or more roles  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str where: the filters query parameter (ex.: {\"number\": 10})
        :param str sort: the sort query parameter (ex.: \"city,-lastname\")
        :param int page: the pages query parameter
        :param int max_results: the max results query parameter
        :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(InlineResponse20011, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['where', 'sort', 'page', 'max_results']  # 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 getroles" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

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

        return self.api_client.call_api(
            '/roles', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20011',  # 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 getroles_item(self, roles_id, **kwargs):  # noqa: E501
        """Retrieves a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :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: Roles
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.getroles_item_with_http_info(roles_id, **kwargs)  # noqa: E501

    def getroles_item_with_http_info(self, roles_id, **kwargs):  # noqa: E501
        """Retrieves a roles document  # noqa: E501

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

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

        local_var_params = locals()

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

        collection_formats = {}

        path_params = {}
        if 'roles_id' in local_var_params:
            path_params['rolesId'] = local_var_params['roles_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 = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']  # noqa: E501

        return self.api_client.call_api(
            '/roles/{rolesId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Roles',  # 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 patchroles_item(self, roles_id, if_match, roles, **kwargs):  # noqa: E501
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.patchroles_item_with_http_info(roles_id, if_match, roles, **kwargs)  # noqa: E501

    def patchroles_item_with_http_info(self, roles_id, if_match, roles, **kwargs):  # noqa: E501
        """Updates a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']  # 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 patchroles_item" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'roles_id' is set
        if ('roles_id' not in local_var_params or
                local_var_params['roles_id'] is None):
            raise ApiValueError("Missing the required parameter `roles_id` when calling `patchroles_item`")  # noqa: E501
        # verify the required parameter 'if_match' is set
        if ('if_match' not in local_var_params or
                local_var_params['if_match'] is None):
            raise ApiValueError("Missing the required parameter `if_match` when calling `patchroles_item`")  # noqa: E501
        # verify the required parameter 'roles' is set
        if ('roles' not in local_var_params or
                local_var_params['roles'] is None):
            raise ApiValueError("Missing the required parameter `roles` when calling `patchroles_item`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        # 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 = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']  # noqa: E501

        return self.api_client.call_api(
            '/roles/{rolesId}', '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)

    def postroles(self, roles, **kwargs):  # noqa: E501
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.postroles_with_http_info(roles, **kwargs)  # noqa: E501

    def postroles_with_http_info(self, roles, **kwargs):  # noqa: E501
        """Stores one or more roles.  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param Roles roles: A roles or list of roles documents (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 = ['roles']  # 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 postroles" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'roles' is set
        if ('roles' not in local_var_params or
                local_var_params['roles'] is None):
            raise ApiValueError("Missing the required parameter `roles` when calling `postroles`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        # 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 = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']  # noqa: E501

        return self.api_client.call_api(
            '/roles', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def putroles_item(self, roles_id, if_match, roles, **kwargs):  # noqa: E501
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (required)
        :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.
        """
        kwargs['_return_http_data_only'] = True
        return self.putroles_item_with_http_info(roles_id, if_match, roles, **kwargs)  # noqa: E501

    def putroles_item_with_http_info(self, roles_id, if_match, roles, **kwargs):  # noqa: E501
        """Replaces a roles document  # noqa: E501

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

        :param async_req bool: execute request asynchronously
        :param str roles_id: (required)
        :param str if_match: Current value of the _etag field (required)
        :param Roles roles: A roles or list of roles documents (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 = ['roles_id', 'if_match', 'roles']  # 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 putroles_item" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'roles_id' is set
        if ('roles_id' not in local_var_params or
                local_var_params['roles_id'] is None):
            raise ApiValueError("Missing the required parameter `roles_id` when calling `putroles_item`")  # noqa: E501
        # verify the required parameter 'if_match' is set
        if ('if_match' not in local_var_params or
                local_var_params['if_match'] is None):
            raise ApiValueError("Missing the required parameter `if_match` when calling `putroles_item`")  # noqa: E501
        # verify the required parameter 'roles' is set
        if ('roles' not in local_var_params or
                local_var_params['roles'] is None):
            raise ApiValueError("Missing the required parameter `roles` when calling `putroles_item`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}
        if 'if_match' in local_var_params:
            header_params['If-Match'] = local_var_params['if_match']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        if 'roles' in local_var_params:
            body_params = local_var_params['roles']
        # 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 = ['ApiKeyHeaderAuth', 'ApiKeyQueryAuth']  # noqa: E501

        return self.api_client.call_api(
            '/roles/{rolesId}', 'PUT',
            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)
