=begin #Ory APIs #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. The version of the OpenAPI document: v1.13.4 Contact: support@ory.sh Generated by: https://openapi-generator.tech Generator version: 7.7.0 =end require 'cgi' module OryClient class ProjectApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create a B2B SSO Organization # @param project_id [String] Project ID The project'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 a B2B SSO Organization # @param project_id [String] Project ID The project'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']) # 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 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']) # 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 token # Create an API token 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 token # Create an API token 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']) # 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 a B2B SSO Organization for a project # @param project_id [String] Project ID The project's ID. # @param organization_id [String] Organization ID The Organization'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 a B2B SSO Organization for a project # @param project_id [String] Project ID The project's ID. # @param organization_id [String] Organization ID The Organization'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']) # 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 project API token # Deletes an API token 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 token # Deletes an API token 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']) # 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 # Returns a B2B SSO Organization for a project by its ID # @param project_id [String] Project ID The project's ID. # @param organization_id [String] Organization ID The Organization'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 # Returns a B2B SSO Organization for a project by its ID # @param project_id [String] Project ID The project's ID. # @param organization_id [String] Organization ID The Organization'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']) # 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 a Project # Get a projects you have access to by its ID. # @param project_id [String] Project ID The project'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'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']) # 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] 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 `OWNER` or `DEVELOPER`. # @param project [String] # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array' # 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 B2B SSO Organizations for a project # @param project_id [String] Project ID The project'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 B2B SSO Organizations for a project # @param project_id [String] Project ID The project'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']) # 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 Tokens # A list of all the project's API tokens. # @param project [String] The Project ID or Project slug # @param [Hash] opts the optional parameters # @return [Array] 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's API Tokens # A list of all the project's API tokens. # @param project [String] The Project ID or Project slug # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array' # 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] 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, Integer, Hash)>] Array 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array' # 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's ID. # @param [Hash] opts the optional parameters # @option opts [Array] :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 `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's ID. # @param [Hash] opts the optional parameters # @option opts [Array] :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']) # 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 # 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. !! Use with extreme caution !! # @param project_id [String] Project ID The project'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. !! Use with extreme caution !! # @param project_id [String] Project ID The project'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']) # 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 `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 [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']) # 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'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 `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'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']) # 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 a B2B SSO Organization for a project # @param project_id [String] Project ID The project's ID. # @param organization_id [String] Organization ID The Organization'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 a B2B SSO Organization for a project # @param project_id [String] Project ID The project's ID. # @param organization_id [String] Organization ID The Organization'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']) # 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 end end