# coding: utf-8

"""
    BillForward REST API


    OpenAPI spec version: 1.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient


class RolesApi(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        config = Configuration()
        if api_client:
            self.api_client = api_client
        else:
            if not config.api_client:
                config.api_client = ApiClient()
            self.api_client = config.api_client

    def create_role(self, role_request, **kwargs):
        """
        Create a new role.
        {\"nickname\":\"Create a new role\",\"request\":\"createRoleRequest.html\",\"response\":\"createRoleResponse.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.create_role(role_request, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param BillingEntityBase role_request:  (required)
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_role_with_http_info(role_request, **kwargs)
        else:
            (data) = self.create_role_with_http_info(role_request, **kwargs)
            return data

    def create_role_with_http_info(self, role_request, **kwargs):
        """
        Create a new role.
        {\"nickname\":\"Create a new role\",\"request\":\"createRoleRequest.html\",\"response\":\"createRoleResponse.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.create_role_with_http_info(role_request, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param BillingEntityBase role_request:  (required)
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role_request']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_role" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role_request' is set
        if ('role_request' not in params) or (params['role_request'] is None):
            raise ValueError("Missing the required parameter `role_request` when calling `create_role`")

        resource_path = '/roles'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'role_request' in params:
            body_params = params['role_request']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['text/xml', 'application/xml', 'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

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

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def get_all_roles(self, **kwargs):
        """
        Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.
        {\"nickname\":\"Retrieve all roles\",\"response\":\"getRoleAll.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_all_roles(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param list[str] organizations: 
        :param int offset: The offset from the first subscription to return.
        :param int records: The maximum number of subscriptions to return.
        :param str order_by: Specify a field used to order the result set.
        :param str order: Ihe direction of any ordering, either ASC or DESC.
        :param bool include_retired: Whether retired subscriptions should be returned.
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_all_roles_with_http_info(**kwargs)
        else:
            (data) = self.get_all_roles_with_http_info(**kwargs)
            return data

    def get_all_roles_with_http_info(self, **kwargs):
        """
        Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.
        {\"nickname\":\"Retrieve all roles\",\"response\":\"getRoleAll.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_all_roles_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param list[str] organizations: 
        :param int offset: The offset from the first subscription to return.
        :param int records: The maximum number of subscriptions to return.
        :param str order_by: Specify a field used to order the result set.
        :param str order: Ihe direction of any ordering, either ASC or DESC.
        :param bool include_retired: Whether retired subscriptions should be returned.
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['organizations', 'offset', 'records', 'order_by', 'order', 'include_retired']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_all_roles" % key
                )
            params[key] = val
        del params['kwargs']

        resource_path = '/roles'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'organizations' in params:
            query_params['organizations'] = params['organizations']
        if 'offset' in params:
            query_params['offset'] = params['offset']
        if 'records' in params:
            query_params['records'] = params['records']
        if 'order_by' in params:
            query_params['order_by'] = params['order_by']
        if 'order' in params:
            query_params['order'] = params['order']
        if 'include_retired' in params:
            query_params['include_retired'] = params['include_retired']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def get_role_by_id(self, role, **kwargs):
        """
        Retrieves a single role, specified by the ID parameter.
        {\"nickname\":\"Retrieve a role\",\"response\":\"getRoleByID.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_role_by_id(role, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param list[str] organizations: 
        :param bool include_retired: Whether retired subscriptions should be returned.
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_role_by_id_with_http_info(role, **kwargs)
        else:
            (data) = self.get_role_by_id_with_http_info(role, **kwargs)
            return data

    def get_role_by_id_with_http_info(self, role, **kwargs):
        """
        Retrieves a single role, specified by the ID parameter.
        {\"nickname\":\"Retrieve a role\",\"response\":\"getRoleByID.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_role_by_id_with_http_info(role, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param list[str] organizations: 
        :param bool include_retired: Whether retired subscriptions should be returned.
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role', 'organizations', 'include_retired']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_role_by_id" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role' is set
        if ('role' not in params) or (params['role'] is None):
            raise ValueError("Missing the required parameter `role` when calling `get_role_by_id`")

        resource_path = '/roles/{role}'.replace('{format}', 'json')
        path_params = {}
        if 'role' in params:
            path_params['role'] = params['role']

        query_params = {}
        if 'organizations' in params:
            query_params['organizations'] = params['organizations']
        if 'include_retired' in params:
            query_params['include_retired'] = params['include_retired']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['text/plain'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def remove_permission_from_role(self, role, resource, action, **kwargs):
        """
        Revokes a particular permission
        {\"nickname\":\"Remove Permission from role\",\"response\":\"removePermissionFromGroup.html\",\"request\":\"removePermissionFromGroupRequest.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.remove_permission_from_role(role, resource, action, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param str resource:  (required)
        :param str action:  (required)
        :param list[str] organizations: 
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.remove_permission_from_role_with_http_info(role, resource, action, **kwargs)
        else:
            (data) = self.remove_permission_from_role_with_http_info(role, resource, action, **kwargs)
            return data

    def remove_permission_from_role_with_http_info(self, role, resource, action, **kwargs):
        """
        Revokes a particular permission
        {\"nickname\":\"Remove Permission from role\",\"response\":\"removePermissionFromGroup.html\",\"request\":\"removePermissionFromGroupRequest.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.remove_permission_from_role_with_http_info(role, resource, action, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param str resource:  (required)
        :param str action:  (required)
        :param list[str] organizations: 
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role', 'resource', 'action', 'organizations']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method remove_permission_from_role" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role' is set
        if ('role' not in params) or (params['role'] is None):
            raise ValueError("Missing the required parameter `role` when calling `remove_permission_from_role`")
        # verify the required parameter 'resource' is set
        if ('resource' not in params) or (params['resource'] is None):
            raise ValueError("Missing the required parameter `resource` when calling `remove_permission_from_role`")
        # verify the required parameter 'action' is set
        if ('action' not in params) or (params['action'] is None):
            raise ValueError("Missing the required parameter `action` when calling `remove_permission_from_role`")

        resource_path = '/roles/{role}/permission/{resource}/{action}'.replace('{format}', 'json')
        path_params = {}
        if 'role' in params:
            path_params['role'] = params['role']
        if 'resource' in params:
            path_params['resource'] = params['resource']
        if 'action' in params:
            path_params['action'] = params['action']

        query_params = {}
        if 'organizations' in params:
            query_params['organizations'] = params['organizations']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['text/plain'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def revoke_role(self, role, **kwargs):
        """
        Revokes a role
        {\"nickname\":\"Revoke role\",\"response\":\"revokeRole.html\",\"request\":\"revokeRoleRequest.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.revoke_role(role, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param list[str] organizations: 
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.revoke_role_with_http_info(role, **kwargs)
        else:
            (data) = self.revoke_role_with_http_info(role, **kwargs)
            return data

    def revoke_role_with_http_info(self, role, **kwargs):
        """
        Revokes a role
        {\"nickname\":\"Revoke role\",\"response\":\"revokeRole.html\",\"request\":\"revokeRoleRequest.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.revoke_role_with_http_info(role, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param list[str] organizations: 
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role', 'organizations']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method revoke_role" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role' is set
        if ('role' not in params) or (params['role'] is None):
            raise ValueError("Missing the required parameter `role` when calling `revoke_role`")

        resource_path = '/roles/{role}'.replace('{format}', 'json')
        path_params = {}
        if 'role' in params:
            path_params['role'] = params['role']

        query_params = {}
        if 'organizations' in params:
            query_params['organizations'] = params['organizations']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['text/plain'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def update_role(self, role_request, **kwargs):
        """
        Update a role.
        {\"nickname\":\"Update a role\",\"request\":\"updateRoleRequest.html\",\"response\":\"updateRoleResponse.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.update_role(role_request, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param UpdateRoleRequest role_request:  (required)
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_role_with_http_info(role_request, **kwargs)
        else:
            (data) = self.update_role_with_http_info(role_request, **kwargs)
            return data

    def update_role_with_http_info(self, role_request, **kwargs):
        """
        Update a role.
        {\"nickname\":\"Update a role\",\"request\":\"updateRoleRequest.html\",\"response\":\"updateRoleResponse.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.update_role_with_http_info(role_request, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param UpdateRoleRequest role_request:  (required)
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role_request']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update_role" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role_request' is set
        if ('role_request' not in params) or (params['role_request'] is None):
            raise ValueError("Missing the required parameter `role_request` when calling `update_role`")

        resource_path = '/roles'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'role_request' in params:
            body_params = params['role_request']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['text/xml', 'application/xml', 'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

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

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'PUT',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

# coding: utf-8

"""
    BillForward REST API


    OpenAPI spec version: 1.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient


class RolesApi(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        config = Configuration()
        if api_client:
            self.api_client = api_client
        else:
            if not config.api_client:
                config.api_client = ApiClient()
            self.api_client = config.api_client

    def create_role(self, role_request, **kwargs):
        """
        Create a new role.
        {\"nickname\":\"Create a new role\",\"request\":\"createRoleRequest.html\",\"response\":\"createRoleResponse.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.create_role(role_request, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param BillingEntityBase role_request:  (required)
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_role_with_http_info(role_request, **kwargs)
        else:
            (data) = self.create_role_with_http_info(role_request, **kwargs)
            return data

    def create_role_with_http_info(self, role_request, **kwargs):
        """
        Create a new role.
        {\"nickname\":\"Create a new role\",\"request\":\"createRoleRequest.html\",\"response\":\"createRoleResponse.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.create_role_with_http_info(role_request, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param BillingEntityBase role_request:  (required)
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role_request']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_role" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role_request' is set
        if ('role_request' not in params) or (params['role_request'] is None):
            raise ValueError("Missing the required parameter `role_request` when calling `create_role`")

        resource_path = '/roles'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'role_request' in params:
            body_params = params['role_request']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['text/xml', 'application/xml', 'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

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

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def get_all_roles(self, **kwargs):
        """
        Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.
        {\"nickname\":\"Retrieve all roles\",\"response\":\"getRoleAll.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_all_roles(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param list[str] organizations: 
        :param int offset: The offset from the first subscription to return.
        :param int records: The maximum number of subscriptions to return.
        :param str order_by: Specify a field used to order the result set.
        :param str order: Ihe direction of any ordering, either ASC or DESC.
        :param bool include_retired: Whether retired subscriptions should be returned.
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_all_roles_with_http_info(**kwargs)
        else:
            (data) = self.get_all_roles_with_http_info(**kwargs)
            return data

    def get_all_roles_with_http_info(self, **kwargs):
        """
        Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.
        {\"nickname\":\"Retrieve all roles\",\"response\":\"getRoleAll.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_all_roles_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param list[str] organizations: 
        :param int offset: The offset from the first subscription to return.
        :param int records: The maximum number of subscriptions to return.
        :param str order_by: Specify a field used to order the result set.
        :param str order: Ihe direction of any ordering, either ASC or DESC.
        :param bool include_retired: Whether retired subscriptions should be returned.
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['organizations', 'offset', 'records', 'order_by', 'order', 'include_retired']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_all_roles" % key
                )
            params[key] = val
        del params['kwargs']

        resource_path = '/roles'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'organizations' in params:
            query_params['organizations'] = params['organizations']
        if 'offset' in params:
            query_params['offset'] = params['offset']
        if 'records' in params:
            query_params['records'] = params['records']
        if 'order_by' in params:
            query_params['order_by'] = params['order_by']
        if 'order' in params:
            query_params['order'] = params['order']
        if 'include_retired' in params:
            query_params['include_retired'] = params['include_retired']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type([])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def get_role_by_id(self, role, **kwargs):
        """
        Retrieves a single role, specified by the ID parameter.
        {\"nickname\":\"Retrieve a role\",\"response\":\"getRoleByID.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_role_by_id(role, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param list[str] organizations: 
        :param bool include_retired: Whether retired subscriptions should be returned.
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_role_by_id_with_http_info(role, **kwargs)
        else:
            (data) = self.get_role_by_id_with_http_info(role, **kwargs)
            return data

    def get_role_by_id_with_http_info(self, role, **kwargs):
        """
        Retrieves a single role, specified by the ID parameter.
        {\"nickname\":\"Retrieve a role\",\"response\":\"getRoleByID.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_role_by_id_with_http_info(role, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param list[str] organizations: 
        :param bool include_retired: Whether retired subscriptions should be returned.
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role', 'organizations', 'include_retired']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_role_by_id" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role' is set
        if ('role' not in params) or (params['role'] is None):
            raise ValueError("Missing the required parameter `role` when calling `get_role_by_id`")

        resource_path = '/roles/{role}'.replace('{format}', 'json')
        path_params = {}
        if 'role' in params:
            path_params['role'] = params['role']

        query_params = {}
        if 'organizations' in params:
            query_params['organizations'] = params['organizations']
        if 'include_retired' in params:
            query_params['include_retired'] = params['include_retired']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['text/plain'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def remove_permission_from_role(self, role, resource, action, **kwargs):
        """
        Revokes a particular permission
        {\"nickname\":\"Remove Permission from role\",\"response\":\"removePermissionFromGroup.html\",\"request\":\"removePermissionFromGroupRequest.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.remove_permission_from_role(role, resource, action, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param str resource:  (required)
        :param str action:  (required)
        :param list[str] organizations: 
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.remove_permission_from_role_with_http_info(role, resource, action, **kwargs)
        else:
            (data) = self.remove_permission_from_role_with_http_info(role, resource, action, **kwargs)
            return data

    def remove_permission_from_role_with_http_info(self, role, resource, action, **kwargs):
        """
        Revokes a particular permission
        {\"nickname\":\"Remove Permission from role\",\"response\":\"removePermissionFromGroup.html\",\"request\":\"removePermissionFromGroupRequest.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.remove_permission_from_role_with_http_info(role, resource, action, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param str resource:  (required)
        :param str action:  (required)
        :param list[str] organizations: 
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role', 'resource', 'action', 'organizations']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method remove_permission_from_role" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role' is set
        if ('role' not in params) or (params['role'] is None):
            raise ValueError("Missing the required parameter `role` when calling `remove_permission_from_role`")
        # verify the required parameter 'resource' is set
        if ('resource' not in params) or (params['resource'] is None):
            raise ValueError("Missing the required parameter `resource` when calling `remove_permission_from_role`")
        # verify the required parameter 'action' is set
        if ('action' not in params) or (params['action'] is None):
            raise ValueError("Missing the required parameter `action` when calling `remove_permission_from_role`")

        resource_path = '/roles/{role}/permission/{resource}/{action}'.replace('{format}', 'json')
        path_params = {}
        if 'role' in params:
            path_params['role'] = params['role']
        if 'resource' in params:
            path_params['resource'] = params['resource']
        if 'action' in params:
            path_params['action'] = params['action']

        query_params = {}
        if 'organizations' in params:
            query_params['organizations'] = params['organizations']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['text/plain'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def revoke_role(self, role, **kwargs):
        """
        Revokes a role
        {\"nickname\":\"Revoke role\",\"response\":\"revokeRole.html\",\"request\":\"revokeRoleRequest.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.revoke_role(role, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param list[str] organizations: 
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.revoke_role_with_http_info(role, **kwargs)
        else:
            (data) = self.revoke_role_with_http_info(role, **kwargs)
            return data

    def revoke_role_with_http_info(self, role, **kwargs):
        """
        Revokes a role
        {\"nickname\":\"Revoke role\",\"response\":\"revokeRole.html\",\"request\":\"revokeRoleRequest.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.revoke_role_with_http_info(role, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str role: ID or name of the role. (required)
        :param list[str] organizations: 
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role', 'organizations']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method revoke_role" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role' is set
        if ('role' not in params) or (params['role'] is None):
            raise ValueError("Missing the required parameter `role` when calling `revoke_role`")

        resource_path = '/roles/{role}'.replace('{format}', 'json')
        path_params = {}
        if 'role' in params:
            path_params['role'] = params['role']

        query_params = {}
        if 'organizations' in params:
            query_params['organizations'] = params['organizations']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['text/plain'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

    def update_role(self, role_request, **kwargs):
        """
        Update a role.
        {\"nickname\":\"Update a role\",\"request\":\"updateRoleRequest.html\",\"response\":\"updateRoleResponse.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.update_role(role_request, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param UpdateRoleRequest role_request:  (required)
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_role_with_http_info(role_request, **kwargs)
        else:
            (data) = self.update_role_with_http_info(role_request, **kwargs)
            return data

    def update_role_with_http_info(self, role_request, **kwargs):
        """
        Update a role.
        {\"nickname\":\"Update a role\",\"request\":\"updateRoleRequest.html\",\"response\":\"updateRoleResponse.html\"}

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.update_role_with_http_info(role_request, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param UpdateRoleRequest role_request:  (required)
        :return: RolePagedMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['role_request']
        all_params.append('callback')
        all_params.append('_return_http_data_only')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update_role" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'role_request' is set
        if ('role_request' not in params) or (params['role_request'] is None):
            raise ValueError("Missing the required parameter `role_request` when calling `update_role`")

        resource_path = '/roles'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'role_request' in params:
            body_params = params['role_request']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['text/xml', 'application/xml', 'application/json'])
        if not header_params['Accept']:
            del header_params['Accept']

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

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api(resource_path, 'PUT',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='RolePagedMetadata',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'),
                                            _return_http_data_only=params.get('_return_http_data_only'))

# coding: utf-8 BillForward REST API       OpenAPI spec version: 1.0.0          Generated by: https://github.com/swagger-api/swagger-codegen.git      Licensed under the Apache License, Version 2.0 (the "License");     you may not use this file except in compliance with the License.     You may obtain a copy of the License at          http://www.apache.org/licenses/LICENSE-2.0      Unless required by applicable law or agreed to in writing, software     distributed under the License is distributed on an "AS IS" BASIS,     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.     See the License for the specific language governing permissions and     limitations under the License. # python 2 and python 3 compatibility library NOTE: This class is auto generated by the swagger code generator program.     Do not edit the class manually.     Ref: https://github.com/swagger-api/swagger-codegen Create a new role.         {\"nickname\":\"Create a new role\",\"request\":\"createRoleRequest.html\",\"response\":\"createRoleResponse.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.create_role(role_request, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param BillingEntityBase role_request:  (required)         :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. Create a new role.         {\"nickname\":\"Create a new role\",\"request\":\"createRoleRequest.html\",\"response\":\"createRoleResponse.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.create_role_with_http_info(role_request, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param BillingEntityBase role_request:  (required)         :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'role_request' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.         {\"nickname\":\"Retrieve all roles\",\"response\":\"getRoleAll.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.get_all_roles(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param list[str] organizations:          :param int offset: The offset from the first subscription to return.         :param int records: The maximum number of subscriptions to return.         :param str order_by: Specify a field used to order the result set.         :param str order: Ihe direction of any ordering, either ASC or DESC.         :param bool include_retired: Whether retired subscriptions should be returned.         :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.         {\"nickname\":\"Retrieve all roles\",\"response\":\"getRoleAll.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.get_all_roles_with_http_info(callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param list[str] organizations:          :param int offset: The offset from the first subscription to return.         :param int records: The maximum number of subscriptions to return.         :param str order_by: Specify a field used to order the result set.         :param str order: Ihe direction of any ordering, either ASC or DESC.         :param bool include_retired: Whether retired subscriptions should be returned.         :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Retrieves a single role, specified by the ID parameter.         {\"nickname\":\"Retrieve a role\",\"response\":\"getRoleByID.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.get_role_by_id(role, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str role: ID or name of the role. (required)         :param list[str] organizations:          :param bool include_retired: Whether retired subscriptions should be returned.         :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. Retrieves a single role, specified by the ID parameter.         {\"nickname\":\"Retrieve a role\",\"response\":\"getRoleByID.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.get_role_by_id_with_http_info(role, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str role: ID or name of the role. (required)         :param list[str] organizations:          :param bool include_retired: Whether retired subscriptions should be returned.         :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'role' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Revokes a particular permission         {\"nickname\":\"Remove Permission from role\",\"response\":\"removePermissionFromGroup.html\",\"request\":\"removePermissionFromGroupRequest.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.remove_permission_from_role(role, resource, action, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str role: ID or name of the role. (required)         :param str resource:  (required)         :param str action:  (required)         :param list[str] organizations:          :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. Revokes a particular permission         {\"nickname\":\"Remove Permission from role\",\"response\":\"removePermissionFromGroup.html\",\"request\":\"removePermissionFromGroupRequest.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.remove_permission_from_role_with_http_info(role, resource, action, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str role: ID or name of the role. (required)         :param str resource:  (required)         :param str action:  (required)         :param list[str] organizations:          :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'role' is set # verify the required parameter 'resource' is set # verify the required parameter 'action' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Revokes a role         {\"nickname\":\"Revoke role\",\"response\":\"revokeRole.html\",\"request\":\"revokeRoleRequest.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.revoke_role(role, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str role: ID or name of the role. (required)         :param list[str] organizations:          :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. Revokes a role         {\"nickname\":\"Revoke role\",\"response\":\"revokeRole.html\",\"request\":\"revokeRoleRequest.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.revoke_role_with_http_info(role, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str role: ID or name of the role. (required)         :param list[str] organizations:          :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'role' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Update a role.         {\"nickname\":\"Update a role\",\"request\":\"updateRoleRequest.html\",\"response\":\"updateRoleResponse.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.update_role(role_request, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param UpdateRoleRequest role_request:  (required)         :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. Update a role.         {\"nickname\":\"Update a role\",\"request\":\"updateRoleRequest.html\",\"response\":\"updateRoleResponse.html\"}          This method makes a synchronous HTTP request by default. To make an         asynchronous HTTP request, please define a `callback` function         to be invoked when receiving the response.         >>> def callback_function(response):         >>>     pprint(response)         >>>         >>> thread = api.update_role_with_http_info(role_request, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param UpdateRoleRequest role_request:  (required)         :return: RolePagedMetadata                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'role_request' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting