# coding: utf-8

"""
    external/v1/auth_service.proto

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

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

    NOTE
    ----
    standard swagger-codegen-cli for this python client has been modified
    by custom templates. The purpose of these templates is to include
    typing information in the API and Model code. Please refer to the
    main grid repository for more info
"""

from __future__ import absolute_import

import re  # noqa: F401
from typing import TYPE_CHECKING, Any

# python 2 and python 3 compatibility library
import six

from lightning_cloud.openapi.api_client import ApiClient

if TYPE_CHECKING:
    from datetime import datetime
    from lightning_cloud.openapi.models import *

class OrganizationsServiceApi(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):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def organizations_service_create_org_membership(self, body: 'OrgIdMembershipsBody', org_id: 'str', **kwargs) -> 'V1OrgMembership':  # noqa: E501
        """organizations_service_create_org_membership  # noqa: E501

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

        :param async_req bool
        :param OrgIdMembershipsBody body: (required)
        :param str org_id: (required)
        :return: V1OrgMembership
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_create_org_membership_with_http_info(body, org_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_create_org_membership_with_http_info(body, org_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_create_org_membership_with_http_info(self, body: 'OrgIdMembershipsBody', org_id: 'str', **kwargs) -> 'V1OrgMembership':  # noqa: E501
        """organizations_service_create_org_membership  # noqa: E501

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

        :param async_req bool
        :param OrgIdMembershipsBody body: (required)
        :param str org_id: (required)
        :return: V1OrgMembership
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'org_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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/memberships', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1OrgMembership',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_create_org_membership_role_binding(self, body: 'UserIdMembershiprolebindingsBody', org_id: 'str', user_id: 'str', **kwargs) -> 'V1OrgMembershipRoleBinding':  # noqa: E501
        """organizations_service_create_org_membership_role_binding  # noqa: E501

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

        :param async_req bool
        :param UserIdMembershiprolebindingsBody body: (required)
        :param str org_id: (required)
        :param str user_id: (required)
        :return: V1OrgMembershipRoleBinding
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_create_org_membership_role_binding_with_http_info(body, org_id, user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_create_org_membership_role_binding_with_http_info(body, org_id, user_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_create_org_membership_role_binding_with_http_info(self, body: 'UserIdMembershiprolebindingsBody', org_id: 'str', user_id: 'str', **kwargs) -> 'V1OrgMembershipRoleBinding':  # noqa: E501
        """organizations_service_create_org_membership_role_binding  # noqa: E501

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

        :param async_req bool
        :param UserIdMembershiprolebindingsBody body: (required)
        :param str org_id: (required)
        :param str user_id: (required)
        :return: V1OrgMembershipRoleBinding
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'org_id', 'user_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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/memberships/{userId}/membershiprolebindings', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1OrgMembershipRoleBinding',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_create_org_role(self, body: 'OrgIdRolesBody', org_id: 'str', **kwargs) -> 'V1OrgRole':  # noqa: E501
        """organizations_service_create_org_role  # noqa: E501

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

        :param async_req bool
        :param OrgIdRolesBody body: (required)
        :param str org_id: (required)
        :return: V1OrgRole
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_create_org_role_with_http_info(body, org_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_create_org_role_with_http_info(body, org_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_create_org_role_with_http_info(self, body: 'OrgIdRolesBody', org_id: 'str', **kwargs) -> 'V1OrgRole':  # noqa: E501
        """organizations_service_create_org_role  # noqa: E501

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

        :param async_req bool
        :param OrgIdRolesBody body: (required)
        :param str org_id: (required)
        :return: V1OrgRole
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'org_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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/roles', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1OrgRole',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_create_organization(self, body: 'V1CreateOrganizationRequest', **kwargs) -> 'V1Organization':  # noqa: E501
        """organizations_service_create_organization  # noqa: E501

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

        :param async_req bool
        :param V1CreateOrganizationRequest body: (required)
        :return: V1Organization
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_create_organization_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_create_organization_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def organizations_service_create_organization_with_http_info(self, body: 'V1CreateOrganizationRequest', **kwargs) -> 'V1Organization':  # noqa: E501
        """organizations_service_create_organization  # noqa: E501

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

        :param async_req bool
        :param V1CreateOrganizationRequest body: (required)
        :return: V1Organization
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = []  # noqa: E501

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

    def organizations_service_delete_org_membership_role_binding(self, org_id: 'str', user_id: 'str', role_id: 'str', **kwargs) -> 'V1DeleteOrgMembershipRoleBindingResponse':  # noqa: E501
        """organizations_service_delete_org_membership_role_binding  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str user_id: (required)
        :param str role_id: (required)
        :return: V1DeleteOrgMembershipRoleBindingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_delete_org_membership_role_binding_with_http_info(org_id, user_id, role_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_delete_org_membership_role_binding_with_http_info(org_id, user_id, role_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_delete_org_membership_role_binding_with_http_info(self, org_id: 'str', user_id: 'str', role_id: 'str', **kwargs) -> 'V1DeleteOrgMembershipRoleBindingResponse':  # noqa: E501
        """organizations_service_delete_org_membership_role_binding  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str user_id: (required)
        :param str role_id: (required)
        :return: V1DeleteOrgMembershipRoleBindingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org_id', 'user_id', 'role_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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501
        if 'role_id' in params:
            path_params['roleId'] = params['role_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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/memberships/{userId}/membershiprolebindings/{roleId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1DeleteOrgMembershipRoleBindingResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_delete_org_project_membership(self, org_id: 'str', user_id: 'str', **kwargs) -> 'V1DeleteOrgMembershipResponse':  # noqa: E501
        """organizations_service_delete_org_project_membership  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str user_id: (required)
        :return: V1DeleteOrgMembershipResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_delete_org_project_membership_with_http_info(org_id, user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_delete_org_project_membership_with_http_info(org_id, user_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_delete_org_project_membership_with_http_info(self, org_id: 'str', user_id: 'str', **kwargs) -> 'V1DeleteOrgMembershipResponse':  # noqa: E501
        """organizations_service_delete_org_project_membership  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str user_id: (required)
        :return: V1DeleteOrgMembershipResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org_id', 'user_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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501
        if 'user_id' in params:
            path_params['userId'] = params['user_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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/memberships/{userId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1DeleteOrgMembershipResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_delete_org_role(self, org_id: 'str', id: 'str', **kwargs) -> 'V1DeleteOrgRoleResponse':  # noqa: E501
        """organizations_service_delete_org_role  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str id: (required)
        :return: V1DeleteOrgRoleResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_delete_org_role_with_http_info(org_id, id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_delete_org_role_with_http_info(org_id, id, **kwargs)  # noqa: E501
            return data

    def organizations_service_delete_org_role_with_http_info(self, org_id: 'str', id: 'str', **kwargs) -> 'V1DeleteOrgRoleResponse':  # noqa: E501
        """organizations_service_delete_org_role  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str id: (required)
        :return: V1DeleteOrgRoleResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org_id', '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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501
        if 'id' in params:
            path_params['id'] = params['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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/roles/{id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1DeleteOrgRoleResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_delete_organization(self, id: 'str', **kwargs) -> 'V1DeleteOrganizationResponse':  # noqa: E501
        """DeleteOrganization deletes the organization with the given ID.  # noqa: E501

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

        :param async_req bool
        :param str id: (required)
        :return: V1DeleteOrganizationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_delete_organization_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_delete_organization_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def organizations_service_delete_organization_with_http_info(self, id: 'str', **kwargs) -> 'V1DeleteOrganizationResponse':  # noqa: E501
        """DeleteOrganization deletes the organization with the given ID.  # noqa: E501

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

        :param async_req bool
        :param str id: (required)
        :return: V1DeleteOrganizationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['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')

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

        collection_formats = {}

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

        return self.api_client.call_api(
            '/v1/orgs/{id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1DeleteOrganizationResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_get_org_role(self, org_id: 'str', id: 'str', **kwargs) -> 'V1OrgRole':  # noqa: E501
        """organizations_service_get_org_role  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str id: (required)
        :return: V1OrgRole
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_get_org_role_with_http_info(org_id, id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_get_org_role_with_http_info(org_id, id, **kwargs)  # noqa: E501
            return data

    def organizations_service_get_org_role_with_http_info(self, org_id: 'str', id: 'str', **kwargs) -> 'V1OrgRole':  # noqa: E501
        """organizations_service_get_org_role  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str id: (required)
        :return: V1OrgRole
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org_id', '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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501
        if 'id' in params:
            path_params['id'] = params['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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/roles/{id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1OrgRole',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_get_organization(self, id: 'str', **kwargs) -> 'V1Organization':  # noqa: E501
        """GetOrganization returns the organization with the given ID.  # noqa: E501

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

        :param async_req bool
        :param str id: (required)
        :param str name:
        :return: V1Organization
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_get_organization_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_get_organization_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def organizations_service_get_organization_with_http_info(self, id: 'str', **kwargs) -> 'V1Organization':  # noqa: E501
        """GetOrganization returns the organization with the given ID.  # noqa: E501

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

        :param async_req bool
        :param str id: (required)
        :param str name:
        :return: V1Organization
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []
        if 'name' in params:
            query_params.append(('name', params['name']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1Organization',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_list_org_members(self, org_id: 'str', **kwargs) -> 'V1ListOrgMembersResponse':  # noqa: E501
        """organizations_service_list_org_members  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param bool include_guests:
        :return: V1ListOrgMembersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_list_org_members_with_http_info(org_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_list_org_members_with_http_info(org_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_list_org_members_with_http_info(self, org_id: 'str', **kwargs) -> 'V1ListOrgMembersResponse':  # noqa: E501
        """organizations_service_list_org_members  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param bool include_guests:
        :return: V1ListOrgMembersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501

        query_params = []
        if 'include_guests' in params:
            query_params.append(('includeGuests', params['include_guests']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/members', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1ListOrgMembersResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_list_org_membership_role_bindings(self, org_id: 'str', user_id: 'str', **kwargs) -> 'V1ListOrgMembershipRoleBindingResponse':  # noqa: E501
        """Org membership role binding  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str user_id: (required)
        :return: V1ListOrgMembershipRoleBindingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_list_org_membership_role_bindings_with_http_info(org_id, user_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_list_org_membership_role_bindings_with_http_info(org_id, user_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_list_org_membership_role_bindings_with_http_info(self, org_id: 'str', user_id: 'str', **kwargs) -> 'V1ListOrgMembershipRoleBindingResponse':  # noqa: E501
        """Org membership role binding  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :param str user_id: (required)
        :return: V1ListOrgMembershipRoleBindingResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org_id', 'user_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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_id']  # noqa: E501
        if 'user_id' in params:
            path_params['userId'] = params['user_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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/memberships/{userId}/membershiprolebindings', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1ListOrgMembershipRoleBindingResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_list_org_memberships(self, org_id: 'str', **kwargs) -> 'V1ListOrgMembershipsResponse':  # noqa: E501
        """Org membership management  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :return: V1ListOrgMembershipsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_list_org_memberships_with_http_info(org_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_list_org_memberships_with_http_info(org_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_list_org_memberships_with_http_info(self, org_id: 'str', **kwargs) -> 'V1ListOrgMembershipsResponse':  # noqa: E501
        """Org membership management  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :return: V1ListOrgMembershipsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org_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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/memberships', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1ListOrgMembershipsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_list_org_roles(self, org_id: 'str', **kwargs) -> 'V1ListOrgRolesResponse':  # noqa: E501
        """Role management  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :return: V1ListOrgRolesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_list_org_roles_with_http_info(org_id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_list_org_roles_with_http_info(org_id, **kwargs)  # noqa: E501
            return data

    def organizations_service_list_org_roles_with_http_info(self, org_id: 'str', **kwargs) -> 'V1ListOrgRolesResponse':  # noqa: E501
        """Role management  # noqa: E501

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

        :param async_req bool
        :param str org_id: (required)
        :return: V1ListOrgRolesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org_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')

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

        collection_formats = {}

        path_params = {}
        if 'org_id' in params:
            path_params['orgId'] = params['org_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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{orgId}/roles', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1ListOrgRolesResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_list_organizations(self, **kwargs) -> 'V1ListOrganizationsResponse':  # noqa: E501
        """TODO: probably a merge with user search API and have a single API to search for anything rpc SearchOrganizations(SearchOrganizationsRequest) returns (SearchOrganizationsResponse) {   option (google.api.http) = {     get: \"/v1/orgs/search\"   }; };  # noqa: E501

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

        :param async_req bool
        :param str role_name:
        :return: V1ListOrganizationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_list_organizations_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_list_organizations_with_http_info(**kwargs)  # noqa: E501
            return data

    def organizations_service_list_organizations_with_http_info(self, **kwargs) -> 'V1ListOrganizationsResponse':  # noqa: E501
        """TODO: probably a merge with user search API and have a single API to search for anything rpc SearchOrganizations(SearchOrganizationsRequest) returns (SearchOrganizationsResponse) {   option (google.api.http) = {     get: \"/v1/orgs/search\"   }; };  # noqa: E501

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

        :param async_req bool
        :param str role_name:
        :return: V1ListOrganizationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'role_name' in params:
            query_params.append(('roleName', params['role_name']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1ListOrganizationsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def organizations_service_update_organization(self, body: 'OrgsIdBody', id: 'str', **kwargs) -> 'V1Organization':  # noqa: E501
        """Update organization  # noqa: E501

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

        :param async_req bool
        :param OrgsIdBody body: (required)
        :param str id: (required)
        :return: V1Organization
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.organizations_service_update_organization_with_http_info(body, id, **kwargs)  # noqa: E501
        else:
            (data) = self.organizations_service_update_organization_with_http_info(body, id, **kwargs)  # noqa: E501
            return data

    def organizations_service_update_organization_with_http_info(self, body: 'OrgsIdBody', id: 'str', **kwargs) -> 'V1Organization':  # noqa: E501
        """Update organization  # noqa: E501

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

        :param async_req bool
        :param OrgsIdBody body: (required)
        :param str id: (required)
        :return: V1Organization
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', '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')

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/orgs/{id}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1Organization',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
