=begin #Ory Kratos #Welcome to the ORY Kratos HTTP API documentation! The version of the OpenAPI document: v0.5.5-alpha.4 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.0.0 =end require 'cgi' module OryHydraClient class AdminApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create an Identity # This endpoint creates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future. Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param [Hash] opts the optional parameters # @option opts [CreateIdentity] :body # @return [Identity] def create_identity(opts = {}) data, _status_code, _headers = create_identity_with_http_info(opts) data end # Create an Identity # This endpoint creates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future. Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param [Hash] opts the optional parameters # @option opts [CreateIdentity] :body # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers def create_identity_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.create_identity ...' end # resource path local_var_path = '/identities' # 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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:debug_return_type] || 'Identity' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.create_identity", :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: AdminApi#create_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a Recovery Link # This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account. # @param [Hash] opts the optional parameters # @option opts [CreateRecoveryLink] :body # @return [RecoveryLink] def create_recovery_link(opts = {}) data, _status_code, _headers = create_recovery_link_with_http_info(opts) data end # Create a Recovery Link # This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account. # @param [Hash] opts the optional parameters # @option opts [CreateRecoveryLink] :body # @return [Array<(RecoveryLink, Integer, Hash)>] RecoveryLink data, response status code and response headers def create_recovery_link_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.create_recovery_link ...' end # resource path local_var_path = '/recovery/link' # 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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:debug_return_type] || 'RecoveryLink' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.create_recovery_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: AdminApi#create_recovery_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete an Identity # Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already. Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID is the identity's ID. # @param [Hash] opts the optional parameters # @return [nil] def delete_identity(id, opts = {}) delete_identity_with_http_info(id, opts) nil end # Delete an Identity # Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already. Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID is the identity's ID. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_identity_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.delete_identity ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.delete_identity" end # resource path local_var_path = '/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || [] new_options = opts.merge( :operation => :"AdminApi.delete_identity", :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: AdminApi#delete_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an Identity # Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to get # @param [Hash] opts the optional parameters # @return [Identity] def get_identity(id, opts = {}) data, _status_code, _headers = get_identity_with_http_info(id, opts) data end # Get an Identity # Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to get # @param [Hash] opts the optional parameters # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers def get_identity_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.get_identity ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.get_identity" end # resource path local_var_path = '/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'Identity' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.get_identity", :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: AdminApi#get_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a Traits Schema Definition # @param id [String] ID must be set to the ID of schema you want to get # @param [Hash] opts the optional parameters # @return [Object] def get_schema(id, opts = {}) data, _status_code, _headers = get_schema_with_http_info(id, opts) data end # Get a Traits Schema Definition # @param id [String] ID must be set to the ID of schema you want to get # @param [Hash] opts the optional parameters # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers def get_schema_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.get_schema ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.get_schema" end # resource path local_var_path = '/schemas/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.get_schema", :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: AdminApi#get_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get User-Facing Self-Service Errors # This endpoint returns the error associated with a user-facing self service errors. This endpoint supports stub values to help you implement the error UI: `?error=stub:500` - returns a stub 500 (Internal Server Error) error. More information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors). # @param error [String] Error is the container's ID # @param [Hash] opts the optional parameters # @return [ErrorContainer] def get_self_service_error(error, opts = {}) data, _status_code, _headers = get_self_service_error_with_http_info(error, opts) data end # Get User-Facing Self-Service Errors # This endpoint returns the error associated with a user-facing self service errors. This endpoint supports stub values to help you implement the error UI: `?error=stub:500` - returns a stub 500 (Internal Server Error) error. More information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors). # @param error [String] Error is the container's ID # @param [Hash] opts the optional parameters # @return [Array<(ErrorContainer, Integer, Hash)>] ErrorContainer data, response status code and response headers def get_self_service_error_with_http_info(error, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.get_self_service_error ...' end # verify the required parameter 'error' is set if @api_client.config.client_side_validation && error.nil? fail ArgumentError, "Missing the required parameter 'error' when calling AdminApi.get_self_service_error" end # resource path local_var_path = '/self-service/errors' # query parameters query_params = opts[:query_params] || {} query_params[:'error'] = error # 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] || 'ErrorContainer' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.get_self_service_error", :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: AdminApi#get_self_service_error\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Login Flow # This endpoint returns a login flow's context with, for example, error details and other information. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). # @param id [String] The Login Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/login?flow=abcde`). # @param [Hash] opts the optional parameters # @return [LoginFlow] def get_self_service_login_flow(id, opts = {}) data, _status_code, _headers = get_self_service_login_flow_with_http_info(id, opts) data end # Get Login Flow # This endpoint returns a login flow's context with, for example, error details and other information. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). # @param id [String] The Login Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/login?flow=abcde`). # @param [Hash] opts the optional parameters # @return [Array<(LoginFlow, Integer, Hash)>] LoginFlow data, response status code and response headers def get_self_service_login_flow_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.get_self_service_login_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.get_self_service_login_flow" end # resource path local_var_path = '/self-service/login/flows' # query parameters query_params = opts[:query_params] || {} query_params[:'id'] = id # 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] || 'LoginFlow' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.get_self_service_login_flow", :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: AdminApi#get_self_service_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get information about a recovery flow # This endpoint returns a recovery flow's context with, for example, error details and other information. More information can be found at [ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). # @param id [String] The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/recovery?flow=abcde`). # @param [Hash] opts the optional parameters # @return [RecoveryFlow] def get_self_service_recovery_flow(id, opts = {}) data, _status_code, _headers = get_self_service_recovery_flow_with_http_info(id, opts) data end # Get information about a recovery flow # This endpoint returns a recovery flow's context with, for example, error details and other information. More information can be found at [ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). # @param id [String] The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/recovery?flow=abcde`). # @param [Hash] opts the optional parameters # @return [Array<(RecoveryFlow, Integer, Hash)>] RecoveryFlow data, response status code and response headers def get_self_service_recovery_flow_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.get_self_service_recovery_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.get_self_service_recovery_flow" end # resource path local_var_path = '/self-service/recovery/flows' # query parameters query_params = opts[:query_params] || {} query_params[:'id'] = id # 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] || 'RecoveryFlow' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.get_self_service_recovery_flow", :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: AdminApi#get_self_service_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Registration Flow # This endpoint returns a registration flow's context with, for example, error details and other information. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). # @param id [String] The Registration Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/registration?flow=abcde`). # @param [Hash] opts the optional parameters # @return [RegistrationFlow] def get_self_service_registration_flow(id, opts = {}) data, _status_code, _headers = get_self_service_registration_flow_with_http_info(id, opts) data end # Get Registration Flow # This endpoint returns a registration flow's context with, for example, error details and other information. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). # @param id [String] The Registration Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/registration?flow=abcde`). # @param [Hash] opts the optional parameters # @return [Array<(RegistrationFlow, Integer, Hash)>] RegistrationFlow data, response status code and response headers def get_self_service_registration_flow_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.get_self_service_registration_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.get_self_service_registration_flow" end # resource path local_var_path = '/self-service/registration/flows' # query parameters query_params = opts[:query_params] || {} query_params[:'id'] = id # 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] || 'RegistrationFlow' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.get_self_service_registration_flow", :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: AdminApi#get_self_service_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Settings Flow # When accessing this endpoint through ORY Kratos' Public API you must ensure that either the ORY Kratos Session Cookie or the ORY Kratos Session Token are set. The public endpoint does not return 404 status codes but instead 403 or 500 to improve data privacy. You can access this endpoint without credentials when using ORY Kratos' Admin API. More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). # @param id [String] ID is the Settings Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/settings?flow=abcde`). # @param [Hash] opts the optional parameters # @return [SettingsFlow] def get_self_service_settings_flow(id, opts = {}) data, _status_code, _headers = get_self_service_settings_flow_with_http_info(id, opts) data end # Get Settings Flow # When accessing this endpoint through ORY Kratos' Public API you must ensure that either the ORY Kratos Session Cookie or the ORY Kratos Session Token are set. The public endpoint does not return 404 status codes but instead 403 or 500 to improve data privacy. You can access this endpoint without credentials when using ORY Kratos' Admin API. More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). # @param id [String] ID is the Settings Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/settings?flow=abcde`). # @param [Hash] opts the optional parameters # @return [Array<(SettingsFlow, Integer, Hash)>] SettingsFlow data, response status code and response headers def get_self_service_settings_flow_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.get_self_service_settings_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.get_self_service_settings_flow" end # resource path local_var_path = '/self-service/settings/flows' # query parameters query_params = opts[:query_params] || {} query_params[:'id'] = id # 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] || 'SettingsFlow' # auth_names auth_names = opts[:debug_auth_names] || ['sessionToken'] new_options = opts.merge( :operation => :"AdminApi.get_self_service_settings_flow", :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: AdminApi#get_self_service_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Verification Flow # This endpoint returns a verification flow's context with, for example, error details and other information. More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). # @param id [String] The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/verification?flow=abcde`). # @param [Hash] opts the optional parameters # @return [VerificationFlow] def get_self_service_verification_flow(id, opts = {}) data, _status_code, _headers = get_self_service_verification_flow_with_http_info(id, opts) data end # Get Verification Flow # This endpoint returns a verification flow's context with, for example, error details and other information. More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). # @param id [String] The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/verification?flow=abcde`). # @param [Hash] opts the optional parameters # @return [Array<(VerificationFlow, Integer, Hash)>] VerificationFlow data, response status code and response headers def get_self_service_verification_flow_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.get_self_service_verification_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.get_self_service_verification_flow" end # resource path local_var_path = '/self-service/verification/flows' # query parameters query_params = opts[:query_params] || {} query_params[:'id'] = id # 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] || 'VerificationFlow' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.get_self_service_verification_flow", :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: AdminApi#get_self_service_verification_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Identities # Lists all identities. Does not support search at the moment. Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param [Hash] opts the optional parameters # @option opts [Integer] :per_page Items per Page This is the number of items per page. (default to 100) # @option opts [Integer] :page Pagination Page (default to 0) # @return [Array] def list_identities(opts = {}) data, _status_code, _headers = list_identities_with_http_info(opts) data end # List Identities # Lists all identities. Does not support search at the moment. Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param [Hash] opts the optional parameters # @option opts [Integer] :per_page Items per Page This is the number of items per page. # @option opts [Integer] :page Pagination Page # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_identities_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.list_identities ...' end if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 500 fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AdminApi.list_identities, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1 fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AdminApi.list_identities, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AdminApi.list_identities, must be greater than or equal to 0.' end # resource path local_var_path = '/identities' # query parameters query_params = opts[:query_params] || {} query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].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] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.list_identities", :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: AdminApi#list_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get snapshot metrics from the Hydra service. If you're using k8s, you can then add annotations to your deployment like so: # ``` metadata: annotations: prometheus.io/port: \"4434\" prometheus.io/path: \"/metrics/prometheus\" ``` # @param [Hash] opts the optional parameters # @return [nil] def prometheus(opts = {}) prometheus_with_http_info(opts) nil end # Get snapshot metrics from the Hydra service. If you're using k8s, you can then add annotations to your deployment like so: # ``` metadata: annotations: prometheus.io/port: \"4434\" prometheus.io/path: \"/metrics/prometheus\" ``` # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def prometheus_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.prometheus ...' end # resource path local_var_path = '/metrics/prometheus' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # 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] || [] new_options = opts.merge( :operation => :"AdminApi.prometheus", :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: AdminApi#prometheus\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an Identity # This endpoint updates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future. The full identity payload (except credentials) is expected. This endpoint does not support patching. Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to update # @param [Hash] opts the optional parameters # @option opts [UpdateIdentity] :body # @return [Identity] def update_identity(id, opts = {}) data, _status_code, _headers = update_identity_with_http_info(id, opts) data end # Update an Identity # This endpoint updates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future. The full identity payload (except credentials) is expected. This endpoint does not support patching. Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). # @param id [String] ID must be set to the ID of identity you want to update # @param [Hash] opts the optional parameters # @option opts [UpdateIdentity] :body # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers def update_identity_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdminApi.update_identity ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.update_identity" end # resource path local_var_path = '/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:debug_return_type] || 'Identity' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"AdminApi.update_identity", :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: AdminApi#update_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end