=begin
#Ory APIs

## Introduction Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.  ## SDKs This document describes the APIs available in the Ory Network. The APIs are available as SDKs for the following languages:  | Language       | Download SDK                                                     | Documentation                                                                        | | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Dart           | [pub.dev](https://pub.dev/packages/ory_client)                   | [README](https://github.com/ory/sdk/blob/master/clients/client/dart/README.md)       | | .NET           | [nuget.org](https://www.nuget.org/packages/Ory.Client/)          | [README](https://github.com/ory/sdk/blob/master/clients/client/dotnet/README.md)     | | Elixir         | [hex.pm](https://hex.pm/packages/ory_client)                     | [README](https://github.com/ory/sdk/blob/master/clients/client/elixir/README.md)     | | Go             | [github.com](https://github.com/ory/client-go)                   | [README](https://github.com/ory/sdk/blob/master/clients/client/go/README.md)         | | Java           | [maven.org](https://search.maven.org/artifact/sh.ory/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/java/README.md)       | | JavaScript     | [npmjs.com](https://www.npmjs.com/package/@ory/client)           | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript/README.md) | | JavaScript (With fetch) | [npmjs.com](https://www.npmjs.com/package/@ory/client-fetch)           | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript-fetch/README.md) |  | PHP            | [packagist.org](https://packagist.org/packages/ory/client)       | [README](https://github.com/ory/sdk/blob/master/clients/client/php/README.md)        | | Python         | [pypi.org](https://pypi.org/project/ory-client/)                 | [README](https://github.com/ory/sdk/blob/master/clients/client/python/README.md)     | | Ruby           | [rubygems.org](https://rubygems.org/gems/ory-client)             | [README](https://github.com/ory/sdk/blob/master/clients/client/ruby/README.md)       | | Rust           | [crates.io](https://crates.io/crates/ory-client)                 | [README](https://github.com/ory/sdk/blob/master/clients/client/rust/README.md)       | 

The version of the OpenAPI document: v1.22.6
Contact: support@ory.sh
Generated by: https://openapi-generator.tech
Generator version: 7.12.0

=end

require 'cgi'

module OryClient
  class ProjectApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Create an Enterprise SSO Organization
    # Creates an Enterprise SSO Organization in a project.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [OrganizationBody] :organization_body 
    # @return [Organization]
    def create_organization(project_id, opts = {})
      data, _status_code, _headers = create_organization_with_http_info(project_id, opts)
      data
    end

    # Create an Enterprise SSO Organization
    # Creates an Enterprise SSO Organization in a project.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [OrganizationBody] :organization_body 
    # @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers
    def create_organization_with_http_info(project_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.create_organization ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.create_organization"
      end
      # resource path
      local_var_path = '/projects/{project_id}/organizations'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'organization_body'])

      # return_type
      return_type = opts[:debug_return_type] || 'Organization'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.create_organization",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create organization onboarding portal link
    # Create a onboarding portal link for an organization.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [CreateOrganizationOnboardingPortalLinkBody] :create_organization_onboarding_portal_link_body 
    # @return [OnboardingPortalLink]
    def create_organization_onboarding_portal_link(project_id, organization_id, opts = {})
      data, _status_code, _headers = create_organization_onboarding_portal_link_with_http_info(project_id, organization_id, opts)
      data
    end

    # Create organization onboarding portal link
    # Create a onboarding portal link for an organization.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [CreateOrganizationOnboardingPortalLinkBody] :create_organization_onboarding_portal_link_body 
    # @return [Array<(OnboardingPortalLink, Integer, Hash)>] OnboardingPortalLink data, response status code and response headers
    def create_organization_onboarding_portal_link_with_http_info(project_id, organization_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.create_organization_onboarding_portal_link ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.create_organization_onboarding_portal_link"
      end
      # verify the required parameter 'organization_id' is set
      if @api_client.config.client_side_validation && organization_id.nil?
        fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectApi.create_organization_onboarding_portal_link"
      end
      # resource path
      local_var_path = '/projects/{project_id}/organizations/{organization_id}/onboarding-portal-links'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_organization_onboarding_portal_link_body'])

      # return_type
      return_type = opts[:debug_return_type] || 'OnboardingPortalLink'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.create_organization_onboarding_portal_link",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#create_organization_onboarding_portal_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create a Project
    # Creates a new project.
    # @param [Hash] opts the optional parameters
    # @option opts [CreateProjectBody] :create_project_body 
    # @return [Project]
    def create_project(opts = {})
      data, _status_code, _headers = create_project_with_http_info(opts)
      data
    end

    # Create a Project
    # Creates a new project.
    # @param [Hash] opts the optional parameters
    # @option opts [CreateProjectBody] :create_project_body 
    # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
    def create_project_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.create_project ...'
      end
      # resource path
      local_var_path = '/projects'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_project_body'])

      # return_type
      return_type = opts[:debug_return_type] || 'Project'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.create_project",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create project API key
    # Create an API key for a project.
    # @param project [String] The Project ID or Project slug
    # @param [Hash] opts the optional parameters
    # @option opts [CreateProjectApiKeyRequest] :create_project_api_key_request 
    # @return [ProjectApiKey]
    def create_project_api_key(project, opts = {})
      data, _status_code, _headers = create_project_api_key_with_http_info(project, opts)
      data
    end

    # Create project API key
    # Create an API key for a project.
    # @param project [String] The Project ID or Project slug
    # @param [Hash] opts the optional parameters
    # @option opts [CreateProjectApiKeyRequest] :create_project_api_key_request 
    # @return [Array<(ProjectApiKey, Integer, Hash)>] ProjectApiKey data, response status code and response headers
    def create_project_api_key_with_http_info(project, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.create_project_api_key ...'
      end
      # verify the required parameter 'project' is set
      if @api_client.config.client_side_validation && project.nil?
        fail ArgumentError, "Missing the required parameter 'project' when calling ProjectApi.create_project_api_key"
      end
      # resource path
      local_var_path = '/projects/{project}/tokens'.sub('{' + 'project' + '}', CGI.escape(project.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_project_api_key_request'])

      # return_type
      return_type = opts[:debug_return_type] || 'ProjectApiKey'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.create_project_api_key",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#create_project_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete Enterprise SSO Organization
    # Irrecoverably deletes an Enterprise SSO Organization in a project by its ID.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_organization(project_id, organization_id, opts = {})
      delete_organization_with_http_info(project_id, organization_id, opts)
      nil
    end

    # Delete Enterprise SSO Organization
    # Irrecoverably deletes an Enterprise SSO Organization in a project by its ID.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_organization_with_http_info(project_id, organization_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.delete_organization ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.delete_organization"
      end
      # verify the required parameter 'organization_id' is set
      if @api_client.config.client_side_validation && organization_id.nil?
        fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectApi.delete_organization"
      end
      # resource path
      local_var_path = '/projects/{project_id}/organizations/{organization_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.delete_organization",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#delete_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete an organization onboarding portal link
    # Deletes a onboarding portal link for an organization.
    # @param project_id [String] 
    # @param organization_id [String] 
    # @param onboarding_portal_link_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_organization_onboarding_portal_link(project_id, organization_id, onboarding_portal_link_id, opts = {})
      delete_organization_onboarding_portal_link_with_http_info(project_id, organization_id, onboarding_portal_link_id, opts)
      nil
    end

    # Delete an organization onboarding portal link
    # Deletes a onboarding portal link for an organization.
    # @param project_id [String] 
    # @param organization_id [String] 
    # @param onboarding_portal_link_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_organization_onboarding_portal_link_with_http_info(project_id, organization_id, onboarding_portal_link_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.delete_organization_onboarding_portal_link ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.delete_organization_onboarding_portal_link"
      end
      # verify the required parameter 'organization_id' is set
      if @api_client.config.client_side_validation && organization_id.nil?
        fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectApi.delete_organization_onboarding_portal_link"
      end
      # verify the required parameter 'onboarding_portal_link_id' is set
      if @api_client.config.client_side_validation && onboarding_portal_link_id.nil?
        fail ArgumentError, "Missing the required parameter 'onboarding_portal_link_id' when calling ProjectApi.delete_organization_onboarding_portal_link"
      end
      # resource path
      local_var_path = '/projects/{project_id}/organizations/{organization_id}/onboarding-portal-links/{onboarding_portal_link_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s)).sub('{' + 'onboarding_portal_link_id' + '}', CGI.escape(onboarding_portal_link_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.delete_organization_onboarding_portal_link",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#delete_organization_onboarding_portal_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete project API key
    # Deletes an API key and immediately removes it.
    # @param project [String] The Project ID or Project slug
    # @param token_id [String] The Token ID
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_project_api_key(project, token_id, opts = {})
      delete_project_api_key_with_http_info(project, token_id, opts)
      nil
    end

    # Delete project API key
    # Deletes an API key and immediately removes it.
    # @param project [String] The Project ID or Project slug
    # @param token_id [String] The Token ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_project_api_key_with_http_info(project, token_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.delete_project_api_key ...'
      end
      # verify the required parameter 'project' is set
      if @api_client.config.client_side_validation && project.nil?
        fail ArgumentError, "Missing the required parameter 'project' when calling ProjectApi.delete_project_api_key"
      end
      # verify the required parameter 'token_id' is set
      if @api_client.config.client_side_validation && token_id.nil?
        fail ArgumentError, "Missing the required parameter 'token_id' when calling ProjectApi.delete_project_api_key"
      end
      # resource path
      local_var_path = '/projects/{project}/tokens/{token_id}'.sub('{' + 'project' + '}', CGI.escape(project.to_s)).sub('{' + 'token_id' + '}', CGI.escape(token_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.delete_project_api_key",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#delete_project_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get Enterprise SSO Organization by ID
    # Retrieves an Enterprise SSO Organization for a project by its ID
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [GetOrganizationResponse]
    def get_organization(project_id, organization_id, opts = {})
      data, _status_code, _headers = get_organization_with_http_info(project_id, organization_id, opts)
      data
    end

    # Get Enterprise SSO Organization by ID
    # Retrieves an Enterprise SSO Organization for a project by its ID
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [Array<(GetOrganizationResponse, Integer, Hash)>] GetOrganizationResponse data, response status code and response headers
    def get_organization_with_http_info(project_id, organization_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.get_organization ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_organization"
      end
      # verify the required parameter 'organization_id' is set
      if @api_client.config.client_side_validation && organization_id.nil?
        fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectApi.get_organization"
      end
      # resource path
      local_var_path = '/projects/{project_id}/organizations/{organization_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'GetOrganizationResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.get_organization",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#get_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get the organization onboarding portal links
    # Retrieves the organization onboarding portal links.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [OrganizationOnboardingPortalLinksResponse]
    def get_organization_onboarding_portal_links(project_id, organization_id, opts = {})
      data, _status_code, _headers = get_organization_onboarding_portal_links_with_http_info(project_id, organization_id, opts)
      data
    end

    # Get the organization onboarding portal links
    # Retrieves the organization onboarding portal links.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [Array<(OrganizationOnboardingPortalLinksResponse, Integer, Hash)>] OrganizationOnboardingPortalLinksResponse data, response status code and response headers
    def get_organization_onboarding_portal_links_with_http_info(project_id, organization_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.get_organization_onboarding_portal_links ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_organization_onboarding_portal_links"
      end
      # verify the required parameter 'organization_id' is set
      if @api_client.config.client_side_validation && organization_id.nil?
        fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectApi.get_organization_onboarding_portal_links"
      end
      # resource path
      local_var_path = '/projects/{project_id}/organizations/{organization_id}/onboarding-portal-links'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'OrganizationOnboardingPortalLinksResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.get_organization_onboarding_portal_links",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#get_organization_onboarding_portal_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get a Project
    # Get a projects you have access to by its ID.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [Project]
    def get_project(project_id, opts = {})
      data, _status_code, _headers = get_project_with_http_info(project_id, opts)
      data
    end

    # Get a Project
    # Get a projects you have access to by its ID.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
    def get_project_with_http_info(project_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.get_project ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_project"
      end
      # resource path
      local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Project'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.get_project",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get all members associated with this project
    # This endpoint requires the user to be a member of the project with the role `OWNER` or `DEVELOPER`.
    # @param project [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<ProjectMember>]
    def get_project_members(project, opts = {})
      data, _status_code, _headers = get_project_members_with_http_info(project, opts)
      data
    end

    # Get all members associated with this project
    # This endpoint requires the user to be a member of the project with the role &#x60;OWNER&#x60; or &#x60;DEVELOPER&#x60;.
    # @param project [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<ProjectMember>, Integer, Hash)>] Array<ProjectMember> data, response status code and response headers
    def get_project_members_with_http_info(project, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.get_project_members ...'
      end
      # verify the required parameter 'project' is set
      if @api_client.config.client_side_validation && project.nil?
        fail ArgumentError, "Missing the required parameter 'project' when calling ProjectApi.get_project_members"
      end
      # resource path
      local_var_path = '/projects/{project}/members'.sub('{' + 'project' + '}', CGI.escape(project.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Array<ProjectMember>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.get_project_members",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#get_project_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List all Enterprise SSO organizations
    # Lists all Enterprise SSO organizations in a project.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :page_size Items per Page  This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)
    # @option opts [String] :page_token Next Page Token  The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).
    # @option opts [String] :domain Domain  If set, only organizations with that domain will be returned.
    # @return [ListOrganizationsResponse]
    def list_organizations(project_id, opts = {})
      data, _status_code, _headers = list_organizations_with_http_info(project_id, opts)
      data
    end

    # List all Enterprise SSO organizations
    # Lists all Enterprise SSO organizations in a project.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :page_size Items per Page  This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)
    # @option opts [String] :page_token Next Page Token  The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).
    # @option opts [String] :domain Domain  If set, only organizations with that domain will be returned.
    # @return [Array<(ListOrganizationsResponse, Integer, Hash)>] ListOrganizationsResponse data, response status code and response headers
    def list_organizations_with_http_info(project_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.list_organizations ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.list_organizations"
      end
      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.list_organizations, must be smaller than or equal to 1000.'
      end

      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.list_organizations, must be greater than or equal to 1.'
      end

      # resource path
      local_var_path = '/projects/{project_id}/organizations'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
      query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
      query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'ListOrganizationsResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.list_organizations",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List a project's API keys
    # A list of all the project's API keys.
    # @param project [String] The Project ID or Project slug
    # @param [Hash] opts the optional parameters
    # @return [Array<ProjectApiKey>]
    def list_project_api_keys(project, opts = {})
      data, _status_code, _headers = list_project_api_keys_with_http_info(project, opts)
      data
    end

    # List a project&#39;s API keys
    # A list of all the project&#39;s API keys.
    # @param project [String] The Project ID or Project slug
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<ProjectApiKey>, Integer, Hash)>] Array<ProjectApiKey> data, response status code and response headers
    def list_project_api_keys_with_http_info(project, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.list_project_api_keys ...'
      end
      # verify the required parameter 'project' is set
      if @api_client.config.client_side_validation && project.nil?
        fail ArgumentError, "Missing the required parameter 'project' when calling ProjectApi.list_project_api_keys"
      end
      # resource path
      local_var_path = '/projects/{project}/tokens'.sub('{' + 'project' + '}', CGI.escape(project.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Array<ProjectApiKey>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.list_project_api_keys",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#list_project_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List All Projects
    # Lists all projects you have access to.
    # @param [Hash] opts the optional parameters
    # @return [Array<ProjectMetadata>]
    def list_projects(opts = {})
      data, _status_code, _headers = list_projects_with_http_info(opts)
      data
    end

    # List All Projects
    # Lists all projects you have access to.
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<ProjectMetadata>, Integer, Hash)>] Array<ProjectMetadata> data, response status code and response headers
    def list_projects_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.list_projects ...'
      end
      # resource path
      local_var_path = '/projects'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Array<ProjectMetadata>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.list_projects",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Patch an Ory Network Project Configuration
    # Deprecated: Use the `patchProjectWithRevision` endpoint instead to specify the exact revision the patch was generated for.  This endpoints allows you to patch individual Ory Network project configuration keys for Ory's services (identity, permission, ...). The configuration format is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions).  This endpoint expects the `version` key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version.  If you have an older version of a configuration, you should set the version key in the payload!  While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source.  For configuration items that can not be translated to the Ory Network, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [Array<JsonPatch>] :json_patch 
    # @return [SuccessfulProjectUpdate]
    def patch_project(project_id, opts = {})
      data, _status_code, _headers = patch_project_with_http_info(project_id, opts)
      data
    end

    # Patch an Ory Network Project Configuration
    # Deprecated: Use the &#x60;patchProjectWithRevision&#x60; endpoint instead to specify the exact revision the patch was generated for.  This endpoints allows you to patch individual Ory Network project configuration keys for Ory&#39;s services (identity, permission, ...). The configuration format is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions).  This endpoint expects the &#x60;version&#x60; key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version.  If you have an older version of a configuration, you should set the version key in the payload!  While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source.  For configuration items that can not be translated to the Ory Network, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [Array<JsonPatch>] :json_patch 
    # @return [Array<(SuccessfulProjectUpdate, Integer, Hash)>] SuccessfulProjectUpdate data, response status code and response headers
    def patch_project_with_http_info(project_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.patch_project ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.patch_project"
      end
      # resource path
      local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'json_patch'])

      # return_type
      return_type = opts[:debug_return_type] || 'SuccessfulProjectUpdate'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.patch_project",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#patch_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Patch an Ory Network Project Configuration based on a revision ID
    # This endpoints allows you to patch individual Ory Network Project configuration keys for Ory's services (identity, permission, ...). The configuration format is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions).  This endpoint expects the `version` key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version.  If you have an older version of a configuration, you should set the version key in the payload!  While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source.  For configuration items that can not be translated to the Ory Network, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param revision_id [String] Revision ID  The revision ID that this patch was generated for.
    # @param [Hash] opts the optional parameters
    # @option opts [Array<JsonPatch>] :json_patch 
    # @return [SuccessfulProjectUpdate]
    def patch_project_with_revision(project_id, revision_id, opts = {})
      data, _status_code, _headers = patch_project_with_revision_with_http_info(project_id, revision_id, opts)
      data
    end

    # Patch an Ory Network Project Configuration based on a revision ID
    # This endpoints allows you to patch individual Ory Network Project configuration keys for Ory&#39;s services (identity, permission, ...). The configuration format is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions).  This endpoint expects the &#x60;version&#x60; key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version.  If you have an older version of a configuration, you should set the version key in the payload!  While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source.  For configuration items that can not be translated to the Ory Network, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param revision_id [String] Revision ID  The revision ID that this patch was generated for.
    # @param [Hash] opts the optional parameters
    # @option opts [Array<JsonPatch>] :json_patch 
    # @return [Array<(SuccessfulProjectUpdate, Integer, Hash)>] SuccessfulProjectUpdate data, response status code and response headers
    def patch_project_with_revision_with_http_info(project_id, revision_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.patch_project_with_revision ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.patch_project_with_revision"
      end
      # verify the required parameter 'revision_id' is set
      if @api_client.config.client_side_validation && revision_id.nil?
        fail ArgumentError, "Missing the required parameter 'revision_id' when calling ProjectApi.patch_project_with_revision"
      end
      # resource path
      local_var_path = '/projects/{project_id}/revision/{revision_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'revision_id' + '}', CGI.escape(revision_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'json_patch'])

      # return_type
      return_type = opts[:debug_return_type] || 'SuccessfulProjectUpdate'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.patch_project_with_revision",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#patch_project_with_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Irrecoverably purge a project
    # !! Use with extreme caution !!  Using this API endpoint you can purge (completely delete) a project and its data. This action can not be undone and will delete ALL your data.  Calling this endpoint will additionally delete custom domains and other related data.  If the project is linked to a subscription, the subscription needs to be unlinked first.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def purge_project(project_id, opts = {})
      purge_project_with_http_info(project_id, opts)
      nil
    end

    # Irrecoverably purge a project
    # !! Use with extreme caution !!  Using this API endpoint you can purge (completely delete) a project and its data. This action can not be undone and will delete ALL your data.  Calling this endpoint will additionally delete custom domains and other related data.  If the project is linked to a subscription, the subscription needs to be unlinked first.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def purge_project_with_http_info(project_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.purge_project ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.purge_project"
      end
      # resource path
      local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.purge_project",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#purge_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Remove a member associated with this project
    # This also sets their invite status to `REMOVED`. This endpoint requires the user to be a member of the project with the role `OWNER`.
    # @param project [String] 
    # @param member [String] 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def remove_project_member(project, member, opts = {})
      remove_project_member_with_http_info(project, member, opts)
      nil
    end

    # Remove a member associated with this project
    # This also sets their invite status to &#x60;REMOVED&#x60;. This endpoint requires the user to be a member of the project with the role &#x60;OWNER&#x60;.
    # @param project [String] 
    # @param member [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def remove_project_member_with_http_info(project, member, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.remove_project_member ...'
      end
      # verify the required parameter 'project' is set
      if @api_client.config.client_side_validation && project.nil?
        fail ArgumentError, "Missing the required parameter 'project' when calling ProjectApi.remove_project_member"
      end
      # verify the required parameter 'member' is set
      if @api_client.config.client_side_validation && member.nil?
        fail ArgumentError, "Missing the required parameter 'member' when calling ProjectApi.remove_project_member"
      end
      # resource path
      local_var_path = '/projects/{project}/members/{member}'.sub('{' + 'project' + '}', CGI.escape(project.to_s)).sub('{' + 'member' + '}', CGI.escape(member.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.remove_project_member",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#remove_project_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update an Ory Network Project Configuration
    # This endpoints allows you to update the Ory Network project configuration for individual services (identity, permission, ...). The configuration is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions).  This endpoint expects the `version` key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version.  If you have an older version of a configuration, you should set the version key in the payload!  While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source.  For configuration items that can not be translated to the Ory Network, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed.  Be aware that updating any service's configuration will completely override your current configuration for that service!
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [SetProject] :set_project 
    # @return [SuccessfulProjectUpdate]
    def set_project(project_id, opts = {})
      data, _status_code, _headers = set_project_with_http_info(project_id, opts)
      data
    end

    # Update an Ory Network Project Configuration
    # This endpoints allows you to update the Ory Network project configuration for individual services (identity, permission, ...). The configuration is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions).  This endpoint expects the &#x60;version&#x60; key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version.  If you have an older version of a configuration, you should set the version key in the payload!  While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source.  For configuration items that can not be translated to the Ory Network, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed.  Be aware that updating any service&#39;s configuration will completely override your current configuration for that service!
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [SetProject] :set_project 
    # @return [Array<(SuccessfulProjectUpdate, Integer, Hash)>] SuccessfulProjectUpdate data, response status code and response headers
    def set_project_with_http_info(project_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.set_project ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.set_project"
      end
      # resource path
      local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'set_project'])

      # return_type
      return_type = opts[:debug_return_type] || 'SuccessfulProjectUpdate'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.set_project",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#set_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update an Enterprise SSO Organization
    # Updates an Enterprise SSO Organization in a project by its ID.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [OrganizationBody] :organization_body 
    # @return [Organization]
    def update_organization(project_id, organization_id, opts = {})
      data, _status_code, _headers = update_organization_with_http_info(project_id, organization_id, opts)
      data
    end

    # Update an Enterprise SSO Organization
    # Updates an Enterprise SSO Organization in a project by its ID.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param [Hash] opts the optional parameters
    # @option opts [OrganizationBody] :organization_body 
    # @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers
    def update_organization_with_http_info(project_id, organization_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.update_organization ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_organization"
      end
      # verify the required parameter 'organization_id' is set
      if @api_client.config.client_side_validation && organization_id.nil?
        fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectApi.update_organization"
      end
      # resource path
      local_var_path = '/projects/{project_id}/organizations/{organization_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'organization_body'])

      # return_type
      return_type = opts[:debug_return_type] || 'Organization'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.update_organization",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#update_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update organization onboarding portal link
    # Update a onboarding portal link for an organization.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param onboarding_portal_link_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [UpdateOrganizationOnboardingPortalLinkBody] :update_organization_onboarding_portal_link_body 
    # @return [OnboardingPortalLink]
    def update_organization_onboarding_portal_link(project_id, organization_id, onboarding_portal_link_id, opts = {})
      data, _status_code, _headers = update_organization_onboarding_portal_link_with_http_info(project_id, organization_id, onboarding_portal_link_id, opts)
      data
    end

    # Update organization onboarding portal link
    # Update a onboarding portal link for an organization.
    # @param project_id [String] Project ID  The project&#39;s ID.
    # @param organization_id [String] Organization ID  The Organization&#39;s ID.
    # @param onboarding_portal_link_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [UpdateOrganizationOnboardingPortalLinkBody] :update_organization_onboarding_portal_link_body 
    # @return [Array<(OnboardingPortalLink, Integer, Hash)>] OnboardingPortalLink data, response status code and response headers
    def update_organization_onboarding_portal_link_with_http_info(project_id, organization_id, onboarding_portal_link_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProjectApi.update_organization_onboarding_portal_link ...'
      end
      # verify the required parameter 'project_id' is set
      if @api_client.config.client_side_validation && project_id.nil?
        fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_organization_onboarding_portal_link"
      end
      # verify the required parameter 'organization_id' is set
      if @api_client.config.client_side_validation && organization_id.nil?
        fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectApi.update_organization_onboarding_portal_link"
      end
      # verify the required parameter 'onboarding_portal_link_id' is set
      if @api_client.config.client_side_validation && onboarding_portal_link_id.nil?
        fail ArgumentError, "Missing the required parameter 'onboarding_portal_link_id' when calling ProjectApi.update_organization_onboarding_portal_link"
      end
      # resource path
      local_var_path = '/projects/{project_id}/organizations/{organization_id}/onboarding-portal-links/{onboarding_portal_link_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s)).sub('{' + 'onboarding_portal_link_id' + '}', CGI.escape(onboarding_portal_link_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_organization_onboarding_portal_link_body'])

      # return_type
      return_type = opts[:debug_return_type] || 'OnboardingPortalLink'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['oryWorkspaceApiKey']

      new_options = opts.merge(
        :operation => :"ProjectApi.update_organization_onboarding_portal_link",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProjectApi#update_organization_onboarding_portal_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
