diff --git a/lib/zitadel/client/api/action_service_api.rb b/lib/zitadel/client/api/action_service_api.rb deleted file mode 100644 index 87aaa3a1..00000000 --- a/lib/zitadel/client/api/action_service_api.rb +++ /dev/null @@ -1,670 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class ActionServiceApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Create Target - # Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions` - # @param action_service_create_target_request [ActionServiceCreateTargetRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaCreateTargetResponse] - def action_service_create_target(action_service_create_target_request, opts = {}) - data, _status_code, _headers = action_service_create_target_with_http_info(action_service_create_target_request, opts) - data - end - - # Create Target - # Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions` - # @param action_service_create_target_request [ActionServiceCreateTargetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaCreateTargetResponse, Integer, Hash)>] ActionServiceBetaCreateTargetResponse data, response status code and response headers - def action_service_create_target_with_http_info(action_service_create_target_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_create_target ...' # MODIFIED - end - # verify the required parameter 'action_service_create_target_request' is set - if @api_client.config.client_side_validation && action_service_create_target_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_create_target_request' when calling Api::ActionServiceApi.action_service_create_target" # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/targets' - - # 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(action_service_create_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceBetaCreateTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_create_target", # MODIFIED - :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: Api::ActionServiceApi#action_service_create_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # Delete Target - # Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` Required feature flag: - `actions` - # @param id [String] - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaDeleteTargetResponse] - def action_service_delete_target(id, opts = {}) - data, _status_code, _headers = action_service_delete_target_with_http_info(id, opts) - data - end - - # Delete Target - # Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` Required feature flag: - `actions` - # @param id [String] - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaDeleteTargetResponse, Integer, Hash)>] ActionServiceBetaDeleteTargetResponse data, response status code and response headers - def action_service_delete_target_with_http_info(id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_delete_target ...' # MODIFIED - 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 Api::ActionServiceApi.action_service_delete_target" # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/targets/{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']) 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] || 'ActionServiceBetaDeleteTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_delete_target", # MODIFIED - :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: Api::ActionServiceApi#action_service_delete_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # Get Target - # Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions` - # @param id [String] - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaGetTargetResponse] - def action_service_get_target(id, opts = {}) - data, _status_code, _headers = action_service_get_target_with_http_info(id, opts) - data - end - - # Get Target - # Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions` - # @param id [String] - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaGetTargetResponse, Integer, Hash)>] ActionServiceBetaGetTargetResponse data, response status code and response headers - def action_service_get_target_with_http_info(id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_get_target ...' # MODIFIED - 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 Api::ActionServiceApi.action_service_get_target" # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/targets/{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']) 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] || 'ActionServiceBetaGetTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_get_target", # MODIFIED - :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: Api::ActionServiceApi#action_service_get_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # List Execution Functions - # List all available functions which can be used as condition for executions. - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaListExecutionFunctionsResponse] - def action_service_list_execution_functions(opts = {}) - data, _status_code, _headers = action_service_list_execution_functions_with_http_info(opts) - data - end - - # List Execution Functions - # List all available functions which can be used as condition for executions. - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaListExecutionFunctionsResponse, Integer, Hash)>] ActionServiceBetaListExecutionFunctionsResponse data, response status code and response headers - def action_service_list_execution_functions_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_list_execution_functions ...' # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/executions/functions' - - # 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] || 'ActionServiceBetaListExecutionFunctionsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_list_execution_functions", # MODIFIED - :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: Api::ActionServiceApi#action_service_list_execution_functions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # List Execution Methods - # List all available methods which can be used as condition for executions. - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaListExecutionMethodsResponse] - def action_service_list_execution_methods(opts = {}) - data, _status_code, _headers = action_service_list_execution_methods_with_http_info(opts) - data - end - - # List Execution Methods - # List all available methods which can be used as condition for executions. - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaListExecutionMethodsResponse, Integer, Hash)>] ActionServiceBetaListExecutionMethodsResponse data, response status code and response headers - def action_service_list_execution_methods_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_list_execution_methods ...' # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/executions/methods' - - # 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] || 'ActionServiceBetaListExecutionMethodsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_list_execution_methods", # MODIFIED - :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: Api::ActionServiceApi#action_service_list_execution_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # List Execution Services - # List all available services which can be used as condition for executions. - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaListExecutionServicesResponse] - def action_service_list_execution_services(opts = {}) - data, _status_code, _headers = action_service_list_execution_services_with_http_info(opts) - data - end - - # List Execution Services - # List all available services which can be used as condition for executions. - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaListExecutionServicesResponse, Integer, Hash)>] ActionServiceBetaListExecutionServicesResponse data, response status code and response headers - def action_service_list_execution_services_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_list_execution_services ...' # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/executions/services' - - # 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] || 'ActionServiceBetaListExecutionServicesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_list_execution_services", # MODIFIED - :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: Api::ActionServiceApi#action_service_list_execution_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # List Executions - # List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` Required feature flag: - `actions` - # @param [Hash] opts the optional parameters - # @option opts [String] :pagination_offset Starting point for retrieval, in combination of offset used to query a set list of objects. - # @option opts [Integer] :pagination_limit limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - # @option opts [Boolean] :pagination_asc Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - # @option opts [String] :sorting_column The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent. (default to 'EXECUTION_FIELD_NAME_UNSPECIFIED') - # @return [ActionServiceBetaListExecutionsResponse] - def action_service_list_executions(opts = {}) - data, _status_code, _headers = action_service_list_executions_with_http_info(opts) - data - end - - # List Executions - # List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` Required feature flag: - `actions` - # @param [Hash] opts the optional parameters - # @option opts [String] :pagination_offset Starting point for retrieval, in combination of offset used to query a set list of objects. - # @option opts [Integer] :pagination_limit limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - # @option opts [Boolean] :pagination_asc Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - # @option opts [String] :sorting_column The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent. (default to 'EXECUTION_FIELD_NAME_UNSPECIFIED') - # @return [Array<(ActionServiceBetaListExecutionsResponse, Integer, Hash)>] ActionServiceBetaListExecutionsResponse data, response status code and response headers - def action_service_list_executions_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_list_executions ...' # MODIFIED - end - allowable_values = ["EXECUTION_FIELD_NAME_UNSPECIFIED", "EXECUTION_FIELD_NAME_ID", "EXECUTION_FIELD_NAME_CREATED_DATE", "EXECUTION_FIELD_NAME_CHANGED_DATE"] - if @api_client.config.client_side_validation && opts[:'sorting_column'] && !allowable_values.include?(opts[:'sorting_column']) - fail ArgumentError, "invalid value for \"sorting_column\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/v2beta/actions/executions/_search' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'pagination.offset'] = opts[:'pagination_offset'] if !opts[:'pagination_offset'].nil? - query_params[:'pagination.limit'] = opts[:'pagination_limit'] if !opts[:'pagination_limit'].nil? - query_params[:'pagination.asc'] = opts[:'pagination_asc'] if !opts[:'pagination_asc'].nil? - query_params[:'sortingColumn'] = opts[:'sorting_column'] if !opts[:'sorting_column'].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] || 'ActionServiceBetaListExecutionsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_list_executions", # MODIFIED - :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: Api::ActionServiceApi#action_service_list_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # List targets - # List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` Required feature flag: - `actions` - # @param action_service_list_targets_request [ActionServiceListTargetsRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaListTargetsResponse] - def action_service_list_targets(action_service_list_targets_request, opts = {}) - data, _status_code, _headers = action_service_list_targets_with_http_info(action_service_list_targets_request, opts) - data - end - - # List targets - # List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` Required feature flag: - `actions` - # @param action_service_list_targets_request [ActionServiceListTargetsRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaListTargetsResponse, Integer, Hash)>] ActionServiceBetaListTargetsResponse data, response status code and response headers - def action_service_list_targets_with_http_info(action_service_list_targets_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_list_targets ...' # MODIFIED - end - # verify the required parameter 'action_service_list_targets_request' is set - if @api_client.config.client_side_validation && action_service_list_targets_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_list_targets_request' when calling Api::ActionServiceApi.action_service_list_targets" # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/targets/_search' - - # 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(action_service_list_targets_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceBetaListTargetsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_list_targets", # MODIFIED - :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: Api::ActionServiceApi#action_service_list_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # Set Execution - # Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` Required feature flag: - `actions` - # @param action_service_set_execution_request [ActionServiceSetExecutionRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaSetExecutionResponse] - def action_service_set_execution(action_service_set_execution_request, opts = {}) - data, _status_code, _headers = action_service_set_execution_with_http_info(action_service_set_execution_request, opts) - data - end - - # Set Execution - # Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` Required feature flag: - `actions` - # @param action_service_set_execution_request [ActionServiceSetExecutionRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaSetExecutionResponse, Integer, Hash)>] ActionServiceBetaSetExecutionResponse data, response status code and response headers - def action_service_set_execution_with_http_info(action_service_set_execution_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_set_execution ...' # MODIFIED - end - # verify the required parameter 'action_service_set_execution_request' is set - if @api_client.config.client_side_validation && action_service_set_execution_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_set_execution_request' when calling Api::ActionServiceApi.action_service_set_execution" # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/executions' - - # 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(action_service_set_execution_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceBetaSetExecutionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_set_execution", # MODIFIED - :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: Api::ActionServiceApi#action_service_set_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # Update Target - # Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions` - # @param id [String] - # @param action_service_update_target_request [ActionServiceUpdateTargetRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceBetaUpdateTargetResponse] - def action_service_update_target(id, action_service_update_target_request, opts = {}) - data, _status_code, _headers = action_service_update_target_with_http_info(id, action_service_update_target_request, opts) - data - end - - # Update Target - # Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions` - # @param id [String] - # @param action_service_update_target_request [ActionServiceUpdateTargetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ActionServiceBetaUpdateTargetResponse, Integer, Hash)>] ActionServiceBetaUpdateTargetResponse data, response status code and response headers - def action_service_update_target_with_http_info(id, action_service_update_target_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.action_service_update_target ...' # MODIFIED - 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 Api::ActionServiceApi.action_service_update_target" # MODIFIED - end - # verify the required parameter 'action_service_update_target_request' is set - if @api_client.config.client_side_validation && action_service_update_target_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_update_target_request' when calling Api::ActionServiceApi.action_service_update_target" # MODIFIED - end - # resource path - local_var_path = '/v2beta/actions/targets/{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']) 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(action_service_update_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceBetaUpdateTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.action_service_update_target", # MODIFIED - :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: Api::ActionServiceApi#action_service_update_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - end -end diff --git a/lib/zitadel/client/api/beta_action_service_api.rb b/lib/zitadel/client/api/beta_action_service_api.rb new file mode 100644 index 00000000..44deeb3f --- /dev/null +++ b/lib/zitadel/client/api/beta_action_service_api.rb @@ -0,0 +1,702 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'cgi' + +module Zitadel::Client::Api + class BetaActionServiceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # CreateTarget + # Create Target Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions` + # @param beta_action_service_create_target_request [BetaActionServiceCreateTargetRequest] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceCreateTargetResponse] + def create_target(beta_action_service_create_target_request, opts = {}) + data, _status_code, _headers = create_target_with_http_info(beta_action_service_create_target_request, opts) + data + end + + # CreateTarget + # Create Target Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` Required feature flag: - `actions` + # @param beta_action_service_create_target_request [BetaActionServiceCreateTargetRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceCreateTargetResponse, Integer, Hash)>] BetaActionServiceCreateTargetResponse data, response status code and response headers + def create_target_with_http_info(beta_action_service_create_target_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.create_target ...' # MODIFIED + end + # verify the required parameter 'beta_action_service_create_target_request' is set + if @api_client.config.client_side_validation && beta_action_service_create_target_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_action_service_create_target_request' when calling Api::BetaActionServiceApi.create_target" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/CreateTarget' + + # 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(beta_action_service_create_target_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceCreateTargetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.create_target", # MODIFIED + :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: Api::BetaActionServiceApi#create_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # DeleteTarget + # Delete Target Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` Required feature flag: - `actions` + # @param beta_action_service_delete_target_request [BetaActionServiceDeleteTargetRequest] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceDeleteTargetResponse] + def delete_target(beta_action_service_delete_target_request, opts = {}) + data, _status_code, _headers = delete_target_with_http_info(beta_action_service_delete_target_request, opts) + data + end + + # DeleteTarget + # Delete Target Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` Required feature flag: - `actions` + # @param beta_action_service_delete_target_request [BetaActionServiceDeleteTargetRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceDeleteTargetResponse, Integer, Hash)>] BetaActionServiceDeleteTargetResponse data, response status code and response headers + def delete_target_with_http_info(beta_action_service_delete_target_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.delete_target ...' # MODIFIED + end + # verify the required parameter 'beta_action_service_delete_target_request' is set + if @api_client.config.client_side_validation && beta_action_service_delete_target_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_action_service_delete_target_request' when calling Api::BetaActionServiceApi.delete_target" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/DeleteTarget' + + # 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(beta_action_service_delete_target_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceDeleteTargetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.delete_target", # MODIFIED + :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: Api::BetaActionServiceApi#delete_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetTarget + # Get Target Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions` + # @param beta_action_service_get_target_request [BetaActionServiceGetTargetRequest] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceGetTargetResponse] + def get_target(beta_action_service_get_target_request, opts = {}) + data, _status_code, _headers = get_target_with_http_info(beta_action_service_get_target_request, opts) + data + end + + # GetTarget + # Get Target Returns the target identified by the requested ID. Required permission: - `action.target.read` Required feature flag: - `actions` + # @param beta_action_service_get_target_request [BetaActionServiceGetTargetRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceGetTargetResponse, Integer, Hash)>] BetaActionServiceGetTargetResponse data, response status code and response headers + def get_target_with_http_info(beta_action_service_get_target_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.get_target ...' # MODIFIED + end + # verify the required parameter 'beta_action_service_get_target_request' is set + if @api_client.config.client_side_validation && beta_action_service_get_target_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_action_service_get_target_request' when calling Api::BetaActionServiceApi.get_target" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/GetTarget' + + # 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(beta_action_service_get_target_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceGetTargetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.get_target", # MODIFIED + :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: Api::BetaActionServiceApi#get_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListExecutionFunctions + # List Execution Functions List all available functions which can be used as condition for executions. + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceListExecutionFunctionsResponse] + def list_execution_functions(body, opts = {}) + data, _status_code, _headers = list_execution_functions_with_http_info(body, opts) + data + end + + # ListExecutionFunctions + # List Execution Functions List all available functions which can be used as condition for executions. + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceListExecutionFunctionsResponse, Integer, Hash)>] BetaActionServiceListExecutionFunctionsResponse data, response status code and response headers + def list_execution_functions_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_execution_functions ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaActionServiceApi.list_execution_functions" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/ListExecutionFunctions' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceListExecutionFunctionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.list_execution_functions", # MODIFIED + :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: Api::BetaActionServiceApi#list_execution_functions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListExecutionMethods + # List Execution Methods List all available methods which can be used as condition for executions. + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceListExecutionMethodsResponse] + def list_execution_methods(body, opts = {}) + data, _status_code, _headers = list_execution_methods_with_http_info(body, opts) + data + end + + # ListExecutionMethods + # List Execution Methods List all available methods which can be used as condition for executions. + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceListExecutionMethodsResponse, Integer, Hash)>] BetaActionServiceListExecutionMethodsResponse data, response status code and response headers + def list_execution_methods_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_execution_methods ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaActionServiceApi.list_execution_methods" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/ListExecutionMethods' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceListExecutionMethodsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.list_execution_methods", # MODIFIED + :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: Api::BetaActionServiceApi#list_execution_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListExecutionServices + # List Execution Services List all available services which can be used as condition for executions. + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceListExecutionServicesResponse] + def list_execution_services(body, opts = {}) + data, _status_code, _headers = list_execution_services_with_http_info(body, opts) + data + end + + # ListExecutionServices + # List Execution Services List all available services which can be used as condition for executions. + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceListExecutionServicesResponse, Integer, Hash)>] BetaActionServiceListExecutionServicesResponse data, response status code and response headers + def list_execution_services_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_execution_services ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaActionServiceApi.list_execution_services" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/ListExecutionServices' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceListExecutionServicesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.list_execution_services", # MODIFIED + :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: Api::BetaActionServiceApi#list_execution_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListExecutions + # List Executions List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` Required feature flag: - `actions` + # @param beta_action_service_list_executions_request [BetaActionServiceListExecutionsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceListExecutionsResponse] + def list_executions(beta_action_service_list_executions_request, opts = {}) + data, _status_code, _headers = list_executions_with_http_info(beta_action_service_list_executions_request, opts) + data + end + + # ListExecutions + # List Executions List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` Required feature flag: - `actions` + # @param beta_action_service_list_executions_request [BetaActionServiceListExecutionsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceListExecutionsResponse, Integer, Hash)>] BetaActionServiceListExecutionsResponse data, response status code and response headers + def list_executions_with_http_info(beta_action_service_list_executions_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_executions ...' # MODIFIED + end + # verify the required parameter 'beta_action_service_list_executions_request' is set + if @api_client.config.client_side_validation && beta_action_service_list_executions_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_action_service_list_executions_request' when calling Api::BetaActionServiceApi.list_executions" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/ListExecutions' + + # 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(beta_action_service_list_executions_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceListExecutionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.list_executions", # MODIFIED + :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: Api::BetaActionServiceApi#list_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListTargets + # List targets List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` Required feature flag: - `actions` + # @param beta_action_service_list_targets_request [BetaActionServiceListTargetsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceListTargetsResponse] + def list_targets(beta_action_service_list_targets_request, opts = {}) + data, _status_code, _headers = list_targets_with_http_info(beta_action_service_list_targets_request, opts) + data + end + + # ListTargets + # List targets List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` Required feature flag: - `actions` + # @param beta_action_service_list_targets_request [BetaActionServiceListTargetsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceListTargetsResponse, Integer, Hash)>] BetaActionServiceListTargetsResponse data, response status code and response headers + def list_targets_with_http_info(beta_action_service_list_targets_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_targets ...' # MODIFIED + end + # verify the required parameter 'beta_action_service_list_targets_request' is set + if @api_client.config.client_side_validation && beta_action_service_list_targets_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_action_service_list_targets_request' when calling Api::BetaActionServiceApi.list_targets" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/ListTargets' + + # 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(beta_action_service_list_targets_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceListTargetsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.list_targets", # MODIFIED + :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: Api::BetaActionServiceApi#list_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetExecution + # Set Execution Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` Required feature flag: - `actions` + # @param beta_action_service_set_execution_request [BetaActionServiceSetExecutionRequest] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceSetExecutionResponse] + def set_execution(beta_action_service_set_execution_request, opts = {}) + data, _status_code, _headers = set_execution_with_http_info(beta_action_service_set_execution_request, opts) + data + end + + # SetExecution + # Set Execution Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` Required feature flag: - `actions` + # @param beta_action_service_set_execution_request [BetaActionServiceSetExecutionRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceSetExecutionResponse, Integer, Hash)>] BetaActionServiceSetExecutionResponse data, response status code and response headers + def set_execution_with_http_info(beta_action_service_set_execution_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.set_execution ...' # MODIFIED + end + # verify the required parameter 'beta_action_service_set_execution_request' is set + if @api_client.config.client_side_validation && beta_action_service_set_execution_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_action_service_set_execution_request' when calling Api::BetaActionServiceApi.set_execution" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/SetExecution' + + # 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(beta_action_service_set_execution_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceSetExecutionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.set_execution", # MODIFIED + :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: Api::BetaActionServiceApi#set_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # UpdateTarget + # Update Target Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions` + # @param beta_action_service_update_target_request [BetaActionServiceUpdateTargetRequest] + # @param [Hash] opts the optional parameters + # @return [BetaActionServiceUpdateTargetResponse] + def update_target(beta_action_service_update_target_request, opts = {}) + data, _status_code, _headers = update_target_with_http_info(beta_action_service_update_target_request, opts) + data + end + + # UpdateTarget + # Update Target Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` Required feature flag: - `actions` + # @param beta_action_service_update_target_request [BetaActionServiceUpdateTargetRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaActionServiceUpdateTargetResponse, Integer, Hash)>] BetaActionServiceUpdateTargetResponse data, response status code and response headers + def update_target_with_http_info(beta_action_service_update_target_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.update_target ...' # MODIFIED + end + # verify the required parameter 'beta_action_service_update_target_request' is set + if @api_client.config.client_side_validation && beta_action_service_update_target_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_action_service_update_target_request' when calling Api::BetaActionServiceApi.update_target" # MODIFIED + end + # resource path + local_var_path = '/zitadel.action.v2beta.ActionService/UpdateTarget' + + # 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(beta_action_service_update_target_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaActionServiceUpdateTargetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaActionServiceApi.update_target", # MODIFIED + :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: Api::BetaActionServiceApi#update_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + end +end diff --git a/lib/zitadel/client/api/beta_feature_service_api.rb b/lib/zitadel/client/api/beta_feature_service_api.rb new file mode 100644 index 00000000..e2d75856 --- /dev/null +++ b/lib/zitadel/client/api/beta_feature_service_api.rb @@ -0,0 +1,814 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'cgi' + +module Zitadel::Client::Api + class BetaFeatureServiceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # GetInstanceFeatures + # @param beta_feature_service_get_instance_features_request [BetaFeatureServiceGetInstanceFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceGetInstanceFeaturesResponse] + def get_instance_features(beta_feature_service_get_instance_features_request, opts = {}) + data, _status_code, _headers = get_instance_features_with_http_info(beta_feature_service_get_instance_features_request, opts) + data + end + + # GetInstanceFeatures + # @param beta_feature_service_get_instance_features_request [BetaFeatureServiceGetInstanceFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceGetInstanceFeaturesResponse, Integer, Hash)>] BetaFeatureServiceGetInstanceFeaturesResponse data, response status code and response headers + def get_instance_features_with_http_info(beta_feature_service_get_instance_features_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.get_instance_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_get_instance_features_request' is set + if @api_client.config.client_side_validation && beta_feature_service_get_instance_features_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_get_instance_features_request' when calling Api::BetaFeatureServiceApi.get_instance_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/GetInstanceFeatures' + + # 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(beta_feature_service_get_instance_features_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceGetInstanceFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.get_instance_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#get_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetOrganizationFeatures + # @param beta_feature_service_get_organization_features_request [BetaFeatureServiceGetOrganizationFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceGetOrganizationFeaturesResponse] + def get_organization_features(beta_feature_service_get_organization_features_request, opts = {}) + data, _status_code, _headers = get_organization_features_with_http_info(beta_feature_service_get_organization_features_request, opts) + data + end + + # GetOrganizationFeatures + # @param beta_feature_service_get_organization_features_request [BetaFeatureServiceGetOrganizationFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceGetOrganizationFeaturesResponse, Integer, Hash)>] BetaFeatureServiceGetOrganizationFeaturesResponse data, response status code and response headers + def get_organization_features_with_http_info(beta_feature_service_get_organization_features_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.get_organization_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_get_organization_features_request' is set + if @api_client.config.client_side_validation && beta_feature_service_get_organization_features_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_get_organization_features_request' when calling Api::BetaFeatureServiceApi.get_organization_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/GetOrganizationFeatures' + + # 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(beta_feature_service_get_organization_features_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceGetOrganizationFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.get_organization_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#get_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetSystemFeatures + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceGetSystemFeaturesResponse] + def get_system_features(body, opts = {}) + data, _status_code, _headers = get_system_features_with_http_info(body, opts) + data + end + + # GetSystemFeatures + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceGetSystemFeaturesResponse, Integer, Hash)>] BetaFeatureServiceGetSystemFeaturesResponse data, response status code and response headers + def get_system_features_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.get_system_features ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaFeatureServiceApi.get_system_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/GetSystemFeatures' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceGetSystemFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.get_system_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#get_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetUserFeatures + # @param beta_feature_service_get_user_features_request [BetaFeatureServiceGetUserFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceGetUserFeaturesResponse] + def get_user_features(beta_feature_service_get_user_features_request, opts = {}) + data, _status_code, _headers = get_user_features_with_http_info(beta_feature_service_get_user_features_request, opts) + data + end + + # GetUserFeatures + # @param beta_feature_service_get_user_features_request [BetaFeatureServiceGetUserFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceGetUserFeaturesResponse, Integer, Hash)>] BetaFeatureServiceGetUserFeaturesResponse data, response status code and response headers + def get_user_features_with_http_info(beta_feature_service_get_user_features_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.get_user_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_get_user_features_request' is set + if @api_client.config.client_side_validation && beta_feature_service_get_user_features_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_get_user_features_request' when calling Api::BetaFeatureServiceApi.get_user_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/GetUserFeatures' + + # 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(beta_feature_service_get_user_features_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceGetUserFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.get_user_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#get_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ResetInstanceFeatures + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceResetInstanceFeaturesResponse] + def reset_instance_features(body, opts = {}) + data, _status_code, _headers = reset_instance_features_with_http_info(body, opts) + data + end + + # ResetInstanceFeatures + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceResetInstanceFeaturesResponse, Integer, Hash)>] BetaFeatureServiceResetInstanceFeaturesResponse data, response status code and response headers + def reset_instance_features_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.reset_instance_features ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaFeatureServiceApi.reset_instance_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/ResetInstanceFeatures' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceResetInstanceFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.reset_instance_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#reset_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ResetOrganizationFeatures + # @param beta_feature_service_reset_organization_features_request [BetaFeatureServiceResetOrganizationFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceResetOrganizationFeaturesResponse] + def reset_organization_features(beta_feature_service_reset_organization_features_request, opts = {}) + data, _status_code, _headers = reset_organization_features_with_http_info(beta_feature_service_reset_organization_features_request, opts) + data + end + + # ResetOrganizationFeatures + # @param beta_feature_service_reset_organization_features_request [BetaFeatureServiceResetOrganizationFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceResetOrganizationFeaturesResponse, Integer, Hash)>] BetaFeatureServiceResetOrganizationFeaturesResponse data, response status code and response headers + def reset_organization_features_with_http_info(beta_feature_service_reset_organization_features_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.reset_organization_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_reset_organization_features_request' is set + if @api_client.config.client_side_validation && beta_feature_service_reset_organization_features_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_reset_organization_features_request' when calling Api::BetaFeatureServiceApi.reset_organization_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/ResetOrganizationFeatures' + + # 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(beta_feature_service_reset_organization_features_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceResetOrganizationFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.reset_organization_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#reset_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ResetSystemFeatures + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceResetSystemFeaturesResponse] + def reset_system_features(body, opts = {}) + data, _status_code, _headers = reset_system_features_with_http_info(body, opts) + data + end + + # ResetSystemFeatures + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceResetSystemFeaturesResponse, Integer, Hash)>] BetaFeatureServiceResetSystemFeaturesResponse data, response status code and response headers + def reset_system_features_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.reset_system_features ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaFeatureServiceApi.reset_system_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/ResetSystemFeatures' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceResetSystemFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.reset_system_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#reset_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ResetUserFeatures + # @param beta_feature_service_reset_user_features_request [BetaFeatureServiceResetUserFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceResetUserFeaturesResponse] + def reset_user_features(beta_feature_service_reset_user_features_request, opts = {}) + data, _status_code, _headers = reset_user_features_with_http_info(beta_feature_service_reset_user_features_request, opts) + data + end + + # ResetUserFeatures + # @param beta_feature_service_reset_user_features_request [BetaFeatureServiceResetUserFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceResetUserFeaturesResponse, Integer, Hash)>] BetaFeatureServiceResetUserFeaturesResponse data, response status code and response headers + def reset_user_features_with_http_info(beta_feature_service_reset_user_features_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.reset_user_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_reset_user_features_request' is set + if @api_client.config.client_side_validation && beta_feature_service_reset_user_features_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_reset_user_features_request' when calling Api::BetaFeatureServiceApi.reset_user_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/ResetUserFeatures' + + # 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(beta_feature_service_reset_user_features_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceResetUserFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.reset_user_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#reset_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetInstanceFeatures + # @param beta_feature_service_set_instance_features_request [BetaFeatureServiceSetInstanceFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceSetInstanceFeaturesResponse] + def set_instance_features(beta_feature_service_set_instance_features_request, opts = {}) + data, _status_code, _headers = set_instance_features_with_http_info(beta_feature_service_set_instance_features_request, opts) + data + end + + # SetInstanceFeatures + # @param beta_feature_service_set_instance_features_request [BetaFeatureServiceSetInstanceFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceSetInstanceFeaturesResponse, Integer, Hash)>] BetaFeatureServiceSetInstanceFeaturesResponse data, response status code and response headers + def set_instance_features_with_http_info(beta_feature_service_set_instance_features_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.set_instance_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_set_instance_features_request' is set + if @api_client.config.client_side_validation && beta_feature_service_set_instance_features_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_set_instance_features_request' when calling Api::BetaFeatureServiceApi.set_instance_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/SetInstanceFeatures' + + # 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(beta_feature_service_set_instance_features_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceSetInstanceFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.set_instance_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#set_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetOrganizationFeatures + # @param beta_feature_service_set_organization_features_request [BetaFeatureServiceSetOrganizationFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceSetOrganizationFeaturesResponse] + def set_organization_features(beta_feature_service_set_organization_features_request, opts = {}) + data, _status_code, _headers = set_organization_features_with_http_info(beta_feature_service_set_organization_features_request, opts) + data + end + + # SetOrganizationFeatures + # @param beta_feature_service_set_organization_features_request [BetaFeatureServiceSetOrganizationFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceSetOrganizationFeaturesResponse, Integer, Hash)>] BetaFeatureServiceSetOrganizationFeaturesResponse data, response status code and response headers + def set_organization_features_with_http_info(beta_feature_service_set_organization_features_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.set_organization_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_set_organization_features_request' is set + if @api_client.config.client_side_validation && beta_feature_service_set_organization_features_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_set_organization_features_request' when calling Api::BetaFeatureServiceApi.set_organization_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/SetOrganizationFeatures' + + # 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(beta_feature_service_set_organization_features_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceSetOrganizationFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.set_organization_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#set_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetSystemFeatures + # @param beta_feature_service_set_system_features_request [BetaFeatureServiceSetSystemFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceSetSystemFeaturesResponse] + def set_system_features(beta_feature_service_set_system_features_request, opts = {}) + data, _status_code, _headers = set_system_features_with_http_info(beta_feature_service_set_system_features_request, opts) + data + end + + # SetSystemFeatures + # @param beta_feature_service_set_system_features_request [BetaFeatureServiceSetSystemFeaturesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceSetSystemFeaturesResponse, Integer, Hash)>] BetaFeatureServiceSetSystemFeaturesResponse data, response status code and response headers + def set_system_features_with_http_info(beta_feature_service_set_system_features_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.set_system_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_set_system_features_request' is set + if @api_client.config.client_side_validation && beta_feature_service_set_system_features_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_set_system_features_request' when calling Api::BetaFeatureServiceApi.set_system_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/SetSystemFeatures' + + # 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(beta_feature_service_set_system_features_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceSetSystemFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.set_system_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#set_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetUserFeatures + # @param beta_feature_service_set_user_feature_request [BetaFeatureServiceSetUserFeatureRequest] + # @param [Hash] opts the optional parameters + # @return [BetaFeatureServiceSetUserFeaturesResponse] + def set_user_features(beta_feature_service_set_user_feature_request, opts = {}) + data, _status_code, _headers = set_user_features_with_http_info(beta_feature_service_set_user_feature_request, opts) + data + end + + # SetUserFeatures + # @param beta_feature_service_set_user_feature_request [BetaFeatureServiceSetUserFeatureRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaFeatureServiceSetUserFeaturesResponse, Integer, Hash)>] BetaFeatureServiceSetUserFeaturesResponse data, response status code and response headers + def set_user_features_with_http_info(beta_feature_service_set_user_feature_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.set_user_features ...' # MODIFIED + end + # verify the required parameter 'beta_feature_service_set_user_feature_request' is set + if @api_client.config.client_side_validation && beta_feature_service_set_user_feature_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_feature_service_set_user_feature_request' when calling Api::BetaFeatureServiceApi.set_user_features" # MODIFIED + end + # resource path + local_var_path = '/zitadel.feature.v2beta.FeatureService/SetUserFeatures' + + # 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(beta_feature_service_set_user_feature_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaFeatureServiceSetUserFeaturesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaFeatureServiceApi.set_user_features", # MODIFIED + :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: Api::BetaFeatureServiceApi#set_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + end +end diff --git a/lib/zitadel/client/api/beta_o_i_d_c_service_api.rb b/lib/zitadel/client/api/beta_o_i_d_c_service_api.rb new file mode 100644 index 00000000..169b6569 --- /dev/null +++ b/lib/zitadel/client/api/beta_o_i_d_c_service_api.rb @@ -0,0 +1,154 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'cgi' + +module Zitadel::Client::Api + class BetaOIDCServiceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # CreateCallback + # @param beta_oidc_service_create_callback_request [BetaOIDCServiceCreateCallbackRequest] + # @param [Hash] opts the optional parameters + # @return [BetaOIDCServiceCreateCallbackResponse] + def create_callback(beta_oidc_service_create_callback_request, opts = {}) + data, _status_code, _headers = create_callback_with_http_info(beta_oidc_service_create_callback_request, opts) + data + end + + # CreateCallback + # @param beta_oidc_service_create_callback_request [BetaOIDCServiceCreateCallbackRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaOIDCServiceCreateCallbackResponse, Integer, Hash)>] BetaOIDCServiceCreateCallbackResponse data, response status code and response headers + def create_callback_with_http_info(beta_oidc_service_create_callback_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaOIDCServiceApi.create_callback ...' # MODIFIED + end + # verify the required parameter 'beta_oidc_service_create_callback_request' is set + if @api_client.config.client_side_validation && beta_oidc_service_create_callback_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_oidc_service_create_callback_request' when calling Api::BetaOIDCServiceApi.create_callback" # MODIFIED + end + # resource path + local_var_path = '/zitadel.oidc.v2beta.OIDCService/CreateCallback' + + # 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(beta_oidc_service_create_callback_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaOIDCServiceCreateCallbackResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaOIDCServiceApi.create_callback", # MODIFIED + :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: Api::BetaOIDCServiceApi#create_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetAuthRequest + # @param beta_oidc_service_get_auth_request_request [BetaOIDCServiceGetAuthRequestRequest] + # @param [Hash] opts the optional parameters + # @return [BetaOIDCServiceGetAuthRequestResponse] + def get_auth_request(beta_oidc_service_get_auth_request_request, opts = {}) + data, _status_code, _headers = get_auth_request_with_http_info(beta_oidc_service_get_auth_request_request, opts) + data + end + + # GetAuthRequest + # @param beta_oidc_service_get_auth_request_request [BetaOIDCServiceGetAuthRequestRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaOIDCServiceGetAuthRequestResponse, Integer, Hash)>] BetaOIDCServiceGetAuthRequestResponse data, response status code and response headers + def get_auth_request_with_http_info(beta_oidc_service_get_auth_request_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaOIDCServiceApi.get_auth_request ...' # MODIFIED + end + # verify the required parameter 'beta_oidc_service_get_auth_request_request' is set + if @api_client.config.client_side_validation && beta_oidc_service_get_auth_request_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_oidc_service_get_auth_request_request' when calling Api::BetaOIDCServiceApi.get_auth_request" # MODIFIED + end + # resource path + local_var_path = '/zitadel.oidc.v2beta.OIDCService/GetAuthRequest' + + # 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(beta_oidc_service_get_auth_request_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaOIDCServiceGetAuthRequestResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaOIDCServiceApi.get_auth_request", # MODIFIED + :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: Api::BetaOIDCServiceApi#get_auth_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + end +end diff --git a/lib/zitadel/client/api/beta_organization_service_api.rb b/lib/zitadel/client/api/beta_organization_service_api.rb new file mode 100644 index 00000000..fd540f79 --- /dev/null +++ b/lib/zitadel/client/api/beta_organization_service_api.rb @@ -0,0 +1,90 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'cgi' + +module Zitadel::Client::Api + class BetaOrganizationServiceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # AddOrganization + # Create a new organization and grant the user(s) permission to manage it + # @param beta_organization_service_add_organization_request [BetaOrganizationServiceAddOrganizationRequest] + # @param [Hash] opts the optional parameters + # @return [BetaOrganizationServiceAddOrganizationResponse] + def add_organization(beta_organization_service_add_organization_request, opts = {}) + data, _status_code, _headers = add_organization_with_http_info(beta_organization_service_add_organization_request, opts) + data + end + + # AddOrganization + # Create a new organization and grant the user(s) permission to manage it + # @param beta_organization_service_add_organization_request [BetaOrganizationServiceAddOrganizationRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaOrganizationServiceAddOrganizationResponse, Integer, Hash)>] BetaOrganizationServiceAddOrganizationResponse data, response status code and response headers + def add_organization_with_http_info(beta_organization_service_add_organization_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.add_organization ...' # MODIFIED + end + # verify the required parameter 'beta_organization_service_add_organization_request' is set + if @api_client.config.client_side_validation && beta_organization_service_add_organization_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_organization_service_add_organization_request' when calling Api::BetaOrganizationServiceApi.add_organization" # MODIFIED + end + # resource path + local_var_path = '/zitadel.org.v2beta.OrganizationService/AddOrganization' + + # 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(beta_organization_service_add_organization_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaOrganizationServiceAddOrganizationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaOrganizationServiceApi.add_organization", # MODIFIED + :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: Api::BetaOrganizationServiceApi#add_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + end +end diff --git a/lib/zitadel/client/api/beta_session_service_api.rb b/lib/zitadel/client/api/beta_session_service_api.rb new file mode 100644 index 00000000..7ddc7298 --- /dev/null +++ b/lib/zitadel/client/api/beta_session_service_api.rb @@ -0,0 +1,362 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'cgi' + +module Zitadel::Client::Api + class BetaSessionServiceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # CreateSession + # Create a new session + # @param beta_session_service_create_session_request [BetaSessionServiceCreateSessionRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSessionServiceCreateSessionResponse] + def create_session(beta_session_service_create_session_request, opts = {}) + data, _status_code, _headers = create_session_with_http_info(beta_session_service_create_session_request, opts) + data + end + + # CreateSession + # Create a new session + # @param beta_session_service_create_session_request [BetaSessionServiceCreateSessionRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSessionServiceCreateSessionResponse, Integer, Hash)>] BetaSessionServiceCreateSessionResponse data, response status code and response headers + def create_session_with_http_info(beta_session_service_create_session_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.create_session ...' # MODIFIED + end + # verify the required parameter 'beta_session_service_create_session_request' is set + if @api_client.config.client_side_validation && beta_session_service_create_session_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_session_service_create_session_request' when calling Api::BetaSessionServiceApi.create_session" # MODIFIED + end + # resource path + local_var_path = '/zitadel.session.v2beta.SessionService/CreateSession' + + # 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(beta_session_service_create_session_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSessionServiceCreateSessionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSessionServiceApi.create_session", # MODIFIED + :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: Api::BetaSessionServiceApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # DeleteSession + # Terminate a session + # @param beta_session_service_delete_session_request [BetaSessionServiceDeleteSessionRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSessionServiceDeleteSessionResponse] + def delete_session(beta_session_service_delete_session_request, opts = {}) + data, _status_code, _headers = delete_session_with_http_info(beta_session_service_delete_session_request, opts) + data + end + + # DeleteSession + # Terminate a session + # @param beta_session_service_delete_session_request [BetaSessionServiceDeleteSessionRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSessionServiceDeleteSessionResponse, Integer, Hash)>] BetaSessionServiceDeleteSessionResponse data, response status code and response headers + def delete_session_with_http_info(beta_session_service_delete_session_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.delete_session ...' # MODIFIED + end + # verify the required parameter 'beta_session_service_delete_session_request' is set + if @api_client.config.client_side_validation && beta_session_service_delete_session_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_session_service_delete_session_request' when calling Api::BetaSessionServiceApi.delete_session" # MODIFIED + end + # resource path + local_var_path = '/zitadel.session.v2beta.SessionService/DeleteSession' + + # 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(beta_session_service_delete_session_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSessionServiceDeleteSessionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSessionServiceApi.delete_session", # MODIFIED + :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: Api::BetaSessionServiceApi#delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetSession + # GetSession a session + # @param beta_session_service_get_session_request [BetaSessionServiceGetSessionRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSessionServiceGetSessionResponse] + def get_session(beta_session_service_get_session_request, opts = {}) + data, _status_code, _headers = get_session_with_http_info(beta_session_service_get_session_request, opts) + data + end + + # GetSession + # GetSession a session + # @param beta_session_service_get_session_request [BetaSessionServiceGetSessionRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSessionServiceGetSessionResponse, Integer, Hash)>] BetaSessionServiceGetSessionResponse data, response status code and response headers + def get_session_with_http_info(beta_session_service_get_session_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.get_session ...' # MODIFIED + end + # verify the required parameter 'beta_session_service_get_session_request' is set + if @api_client.config.client_side_validation && beta_session_service_get_session_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_session_service_get_session_request' when calling Api::BetaSessionServiceApi.get_session" # MODIFIED + end + # resource path + local_var_path = '/zitadel.session.v2beta.SessionService/GetSession' + + # 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(beta_session_service_get_session_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSessionServiceGetSessionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSessionServiceApi.get_session", # MODIFIED + :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: Api::BetaSessionServiceApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListSessions + # Search sessions + # @param beta_session_service_list_sessions_request [BetaSessionServiceListSessionsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSessionServiceListSessionsResponse] + def list_sessions(beta_session_service_list_sessions_request, opts = {}) + data, _status_code, _headers = list_sessions_with_http_info(beta_session_service_list_sessions_request, opts) + data + end + + # ListSessions + # Search sessions + # @param beta_session_service_list_sessions_request [BetaSessionServiceListSessionsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSessionServiceListSessionsResponse, Integer, Hash)>] BetaSessionServiceListSessionsResponse data, response status code and response headers + def list_sessions_with_http_info(beta_session_service_list_sessions_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.list_sessions ...' # MODIFIED + end + # verify the required parameter 'beta_session_service_list_sessions_request' is set + if @api_client.config.client_side_validation && beta_session_service_list_sessions_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_session_service_list_sessions_request' when calling Api::BetaSessionServiceApi.list_sessions" # MODIFIED + end + # resource path + local_var_path = '/zitadel.session.v2beta.SessionService/ListSessions' + + # 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(beta_session_service_list_sessions_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSessionServiceListSessionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSessionServiceApi.list_sessions", # MODIFIED + :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: Api::BetaSessionServiceApi#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetSession + # Update a session + # @param beta_session_service_set_session_request [BetaSessionServiceSetSessionRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSessionServiceSetSessionResponse] + def set_session(beta_session_service_set_session_request, opts = {}) + data, _status_code, _headers = set_session_with_http_info(beta_session_service_set_session_request, opts) + data + end + + # SetSession + # Update a session + # @param beta_session_service_set_session_request [BetaSessionServiceSetSessionRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSessionServiceSetSessionResponse, Integer, Hash)>] BetaSessionServiceSetSessionResponse data, response status code and response headers + def set_session_with_http_info(beta_session_service_set_session_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.set_session ...' # MODIFIED + end + # verify the required parameter 'beta_session_service_set_session_request' is set + if @api_client.config.client_side_validation && beta_session_service_set_session_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_session_service_set_session_request' when calling Api::BetaSessionServiceApi.set_session" # MODIFIED + end + # resource path + local_var_path = '/zitadel.session.v2beta.SessionService/SetSession' + + # 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(beta_session_service_set_session_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSessionServiceSetSessionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSessionServiceApi.set_session", # MODIFIED + :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: Api::BetaSessionServiceApi#set_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + end +end diff --git a/lib/zitadel/client/api/beta_settings_service_api.rb b/lib/zitadel/client/api/beta_settings_service_api.rb new file mode 100644 index 00000000..024deda1 --- /dev/null +++ b/lib/zitadel/client/api/beta_settings_service_api.rb @@ -0,0 +1,770 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'cgi' + +module Zitadel::Client::Api + class BetaSettingsServiceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # GetActiveIdentityProviders + # Get the current active identity providers + # @param beta_settings_service_get_active_identity_providers_request [BetaSettingsServiceGetActiveIdentityProvidersRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetActiveIdentityProvidersResponse] + def get_active_identity_providers(beta_settings_service_get_active_identity_providers_request, opts = {}) + data, _status_code, _headers = get_active_identity_providers_with_http_info(beta_settings_service_get_active_identity_providers_request, opts) + data + end + + # GetActiveIdentityProviders + # Get the current active identity providers + # @param beta_settings_service_get_active_identity_providers_request [BetaSettingsServiceGetActiveIdentityProvidersRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetActiveIdentityProvidersResponse, Integer, Hash)>] BetaSettingsServiceGetActiveIdentityProvidersResponse data, response status code and response headers + def get_active_identity_providers_with_http_info(beta_settings_service_get_active_identity_providers_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_active_identity_providers ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_get_active_identity_providers_request' is set + if @api_client.config.client_side_validation && beta_settings_service_get_active_identity_providers_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_active_identity_providers_request' when calling Api::BetaSettingsServiceApi.get_active_identity_providers" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetActiveIdentityProviders' + + # 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(beta_settings_service_get_active_identity_providers_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetActiveIdentityProvidersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_active_identity_providers", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_active_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetBrandingSettings + # Get the current active branding settings + # @param beta_settings_service_get_branding_settings_request [BetaSettingsServiceGetBrandingSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetBrandingSettingsResponse] + def get_branding_settings(beta_settings_service_get_branding_settings_request, opts = {}) + data, _status_code, _headers = get_branding_settings_with_http_info(beta_settings_service_get_branding_settings_request, opts) + data + end + + # GetBrandingSettings + # Get the current active branding settings + # @param beta_settings_service_get_branding_settings_request [BetaSettingsServiceGetBrandingSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetBrandingSettingsResponse, Integer, Hash)>] BetaSettingsServiceGetBrandingSettingsResponse data, response status code and response headers + def get_branding_settings_with_http_info(beta_settings_service_get_branding_settings_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_branding_settings ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_get_branding_settings_request' is set + if @api_client.config.client_side_validation && beta_settings_service_get_branding_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_branding_settings_request' when calling Api::BetaSettingsServiceApi.get_branding_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetBrandingSettings' + + # 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(beta_settings_service_get_branding_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetBrandingSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_branding_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_branding_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetDomainSettings + # Get the domain settings + # @param beta_settings_service_get_domain_settings_request [BetaSettingsServiceGetDomainSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetDomainSettingsResponse] + def get_domain_settings(beta_settings_service_get_domain_settings_request, opts = {}) + data, _status_code, _headers = get_domain_settings_with_http_info(beta_settings_service_get_domain_settings_request, opts) + data + end + + # GetDomainSettings + # Get the domain settings + # @param beta_settings_service_get_domain_settings_request [BetaSettingsServiceGetDomainSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetDomainSettingsResponse, Integer, Hash)>] BetaSettingsServiceGetDomainSettingsResponse data, response status code and response headers + def get_domain_settings_with_http_info(beta_settings_service_get_domain_settings_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_domain_settings ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_get_domain_settings_request' is set + if @api_client.config.client_side_validation && beta_settings_service_get_domain_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_domain_settings_request' when calling Api::BetaSettingsServiceApi.get_domain_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetDomainSettings' + + # 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(beta_settings_service_get_domain_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetDomainSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_domain_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_domain_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetGeneralSettings + # Get basic information over the instance + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetGeneralSettingsResponse] + def get_general_settings(body, opts = {}) + data, _status_code, _headers = get_general_settings_with_http_info(body, opts) + data + end + + # GetGeneralSettings + # Get basic information over the instance + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetGeneralSettingsResponse, Integer, Hash)>] BetaSettingsServiceGetGeneralSettingsResponse data, response status code and response headers + def get_general_settings_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_general_settings ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaSettingsServiceApi.get_general_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetGeneralSettings' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetGeneralSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_general_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_general_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetLegalAndSupportSettings + # Get the legal and support settings + # @param beta_settings_service_get_legal_and_support_settings_request [BetaSettingsServiceGetLegalAndSupportSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetLegalAndSupportSettingsResponse] + def get_legal_and_support_settings(beta_settings_service_get_legal_and_support_settings_request, opts = {}) + data, _status_code, _headers = get_legal_and_support_settings_with_http_info(beta_settings_service_get_legal_and_support_settings_request, opts) + data + end + + # GetLegalAndSupportSettings + # Get the legal and support settings + # @param beta_settings_service_get_legal_and_support_settings_request [BetaSettingsServiceGetLegalAndSupportSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetLegalAndSupportSettingsResponse, Integer, Hash)>] BetaSettingsServiceGetLegalAndSupportSettingsResponse data, response status code and response headers + def get_legal_and_support_settings_with_http_info(beta_settings_service_get_legal_and_support_settings_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_legal_and_support_settings ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_get_legal_and_support_settings_request' is set + if @api_client.config.client_side_validation && beta_settings_service_get_legal_and_support_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_legal_and_support_settings_request' when calling Api::BetaSettingsServiceApi.get_legal_and_support_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetLegalAndSupportSettings' + + # 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(beta_settings_service_get_legal_and_support_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetLegalAndSupportSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_legal_and_support_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_legal_and_support_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetLockoutSettings + # Get the lockout settings + # @param beta_settings_service_get_lockout_settings_request [BetaSettingsServiceGetLockoutSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetLockoutSettingsResponse] + def get_lockout_settings(beta_settings_service_get_lockout_settings_request, opts = {}) + data, _status_code, _headers = get_lockout_settings_with_http_info(beta_settings_service_get_lockout_settings_request, opts) + data + end + + # GetLockoutSettings + # Get the lockout settings + # @param beta_settings_service_get_lockout_settings_request [BetaSettingsServiceGetLockoutSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetLockoutSettingsResponse, Integer, Hash)>] BetaSettingsServiceGetLockoutSettingsResponse data, response status code and response headers + def get_lockout_settings_with_http_info(beta_settings_service_get_lockout_settings_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_lockout_settings ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_get_lockout_settings_request' is set + if @api_client.config.client_side_validation && beta_settings_service_get_lockout_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_lockout_settings_request' when calling Api::BetaSettingsServiceApi.get_lockout_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetLockoutSettings' + + # 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(beta_settings_service_get_lockout_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetLockoutSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_lockout_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_lockout_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetLoginSettings + # Get the login settings + # @param beta_settings_service_get_login_settings_request [BetaSettingsServiceGetLoginSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetLoginSettingsResponse] + def get_login_settings(beta_settings_service_get_login_settings_request, opts = {}) + data, _status_code, _headers = get_login_settings_with_http_info(beta_settings_service_get_login_settings_request, opts) + data + end + + # GetLoginSettings + # Get the login settings + # @param beta_settings_service_get_login_settings_request [BetaSettingsServiceGetLoginSettingsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetLoginSettingsResponse, Integer, Hash)>] BetaSettingsServiceGetLoginSettingsResponse data, response status code and response headers + def get_login_settings_with_http_info(beta_settings_service_get_login_settings_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_login_settings ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_get_login_settings_request' is set + if @api_client.config.client_side_validation && beta_settings_service_get_login_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_login_settings_request' when calling Api::BetaSettingsServiceApi.get_login_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetLoginSettings' + + # 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(beta_settings_service_get_login_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetLoginSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_login_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_login_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetPasswordComplexitySettings + # Get the password complexity settings + # @param beta_settings_service_get_password_complexity_settings_request [BetaSettingsServiceGetPasswordComplexitySettingsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetPasswordComplexitySettingsResponse] + def get_password_complexity_settings(beta_settings_service_get_password_complexity_settings_request, opts = {}) + data, _status_code, _headers = get_password_complexity_settings_with_http_info(beta_settings_service_get_password_complexity_settings_request, opts) + data + end + + # GetPasswordComplexitySettings + # Get the password complexity settings + # @param beta_settings_service_get_password_complexity_settings_request [BetaSettingsServiceGetPasswordComplexitySettingsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetPasswordComplexitySettingsResponse, Integer, Hash)>] BetaSettingsServiceGetPasswordComplexitySettingsResponse data, response status code and response headers + def get_password_complexity_settings_with_http_info(beta_settings_service_get_password_complexity_settings_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_password_complexity_settings ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_get_password_complexity_settings_request' is set + if @api_client.config.client_side_validation && beta_settings_service_get_password_complexity_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_password_complexity_settings_request' when calling Api::BetaSettingsServiceApi.get_password_complexity_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetPasswordComplexitySettings' + + # 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(beta_settings_service_get_password_complexity_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetPasswordComplexitySettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_password_complexity_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_password_complexity_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetPasswordExpirySettings + # Get the password expiry settings + # @param beta_settings_service_get_password_expiry_settings_request [BetaSettingsServiceGetPasswordExpirySettingsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetPasswordExpirySettingsResponse] + def get_password_expiry_settings(beta_settings_service_get_password_expiry_settings_request, opts = {}) + data, _status_code, _headers = get_password_expiry_settings_with_http_info(beta_settings_service_get_password_expiry_settings_request, opts) + data + end + + # GetPasswordExpirySettings + # Get the password expiry settings + # @param beta_settings_service_get_password_expiry_settings_request [BetaSettingsServiceGetPasswordExpirySettingsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetPasswordExpirySettingsResponse, Integer, Hash)>] BetaSettingsServiceGetPasswordExpirySettingsResponse data, response status code and response headers + def get_password_expiry_settings_with_http_info(beta_settings_service_get_password_expiry_settings_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_password_expiry_settings ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_get_password_expiry_settings_request' is set + if @api_client.config.client_side_validation && beta_settings_service_get_password_expiry_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_password_expiry_settings_request' when calling Api::BetaSettingsServiceApi.get_password_expiry_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetPasswordExpirySettings' + + # 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(beta_settings_service_get_password_expiry_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetPasswordExpirySettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_password_expiry_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_password_expiry_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetSecuritySettings + # Get the security settings + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceGetSecuritySettingsResponse] + def get_security_settings(body, opts = {}) + data, _status_code, _headers = get_security_settings_with_http_info(body, opts) + data + end + + # GetSecuritySettings + # Get the security settings + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceGetSecuritySettingsResponse, Integer, Hash)>] BetaSettingsServiceGetSecuritySettingsResponse data, response status code and response headers + def get_security_settings_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_security_settings ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaSettingsServiceApi.get_security_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/GetSecuritySettings' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetSecuritySettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.get_security_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#get_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetSecuritySettings + # Set the security settings + # @param beta_settings_service_set_security_settings_request [BetaSettingsServiceSetSecuritySettingsRequest] + # @param [Hash] opts the optional parameters + # @return [BetaSettingsServiceSetSecuritySettingsResponse] + def set_security_settings(beta_settings_service_set_security_settings_request, opts = {}) + data, _status_code, _headers = set_security_settings_with_http_info(beta_settings_service_set_security_settings_request, opts) + data + end + + # SetSecuritySettings + # Set the security settings + # @param beta_settings_service_set_security_settings_request [BetaSettingsServiceSetSecuritySettingsRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaSettingsServiceSetSecuritySettingsResponse, Integer, Hash)>] BetaSettingsServiceSetSecuritySettingsResponse data, response status code and response headers + def set_security_settings_with_http_info(beta_settings_service_set_security_settings_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.set_security_settings ...' # MODIFIED + end + # verify the required parameter 'beta_settings_service_set_security_settings_request' is set + if @api_client.config.client_side_validation && beta_settings_service_set_security_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_settings_service_set_security_settings_request' when calling Api::BetaSettingsServiceApi.set_security_settings" # MODIFIED + end + # resource path + local_var_path = '/zitadel.settings.v2beta.SettingsService/SetSecuritySettings' + + # 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(beta_settings_service_set_security_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaSettingsServiceSetSecuritySettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaSettingsServiceApi.set_security_settings", # MODIFIED + :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: Api::BetaSettingsServiceApi#set_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + end +end diff --git a/lib/zitadel/client/api/beta_user_service_api.rb b/lib/zitadel/client/api/beta_user_service_api.rb new file mode 100644 index 00000000..15fb0644 --- /dev/null +++ b/lib/zitadel/client/api/beta_user_service_api.rb @@ -0,0 +1,2334 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'cgi' + +module Zitadel::Client::Api + class BetaUserServiceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # AddHumanUser + # Create a new human user Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. Deprecated: please move to the corresponding endpoint under user service v2 (GA) + # @param beta_user_service_add_human_user_request [BetaUserServiceAddHumanUserRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceAddHumanUserResponse] + def add_human_user(beta_user_service_add_human_user_request, opts = {}) + data, _status_code, _headers = add_human_user_with_http_info(beta_user_service_add_human_user_request, opts) + data + end + + # AddHumanUser + # Create a new human user Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. Deprecated: please move to the corresponding endpoint under user service v2 (GA) + # @param beta_user_service_add_human_user_request [BetaUserServiceAddHumanUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceAddHumanUserResponse, Integer, Hash)>] BetaUserServiceAddHumanUserResponse data, response status code and response headers + def add_human_user_with_http_info(beta_user_service_add_human_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.add_human_user ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_add_human_user_request' is set + if @api_client.config.client_side_validation && beta_user_service_add_human_user_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_add_human_user_request' when calling Api::BetaUserServiceApi.add_human_user" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/AddHumanUser' + + # 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(beta_user_service_add_human_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceAddHumanUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.add_human_user", # MODIFIED + :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: Api::BetaUserServiceApi#add_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # AddIDPLink + # Add link to an identity provider to an user Add link to an identity provider to an user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_add_idp_link_request [BetaUserServiceAddIDPLinkRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceAddIDPLinkResponse] + def add_idp_link(beta_user_service_add_idp_link_request, opts = {}) + data, _status_code, _headers = add_idp_link_with_http_info(beta_user_service_add_idp_link_request, opts) + data + end + + # AddIDPLink + # Add link to an identity provider to an user Add link to an identity provider to an user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_add_idp_link_request [BetaUserServiceAddIDPLinkRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceAddIDPLinkResponse, Integer, Hash)>] BetaUserServiceAddIDPLinkResponse data, response status code and response headers + def add_idp_link_with_http_info(beta_user_service_add_idp_link_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.add_idp_link ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_add_idp_link_request' is set + if @api_client.config.client_side_validation && beta_user_service_add_idp_link_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_add_idp_link_request' when calling Api::BetaUserServiceApi.add_idp_link" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/AddIDPLink' + + # 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(beta_user_service_add_idp_link_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceAddIDPLinkResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.add_idp_link", # MODIFIED + :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: Api::BetaUserServiceApi#add_idp_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # AddOTPEmail + # Add OTP Email for a user Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_add_otp_email_request [BetaUserServiceAddOTPEmailRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceAddOTPEmailResponse] + def add_otp_email(beta_user_service_add_otp_email_request, opts = {}) + data, _status_code, _headers = add_otp_email_with_http_info(beta_user_service_add_otp_email_request, opts) + data + end + + # AddOTPEmail + # Add OTP Email for a user Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_add_otp_email_request [BetaUserServiceAddOTPEmailRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceAddOTPEmailResponse, Integer, Hash)>] BetaUserServiceAddOTPEmailResponse data, response status code and response headers + def add_otp_email_with_http_info(beta_user_service_add_otp_email_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.add_otp_email ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_add_otp_email_request' is set + if @api_client.config.client_side_validation && beta_user_service_add_otp_email_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_add_otp_email_request' when calling Api::BetaUserServiceApi.add_otp_email" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/AddOTPEmail' + + # 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(beta_user_service_add_otp_email_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceAddOTPEmailResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.add_otp_email", # MODIFIED + :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: Api::BetaUserServiceApi#add_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # AddOTPSMS + # Add OTP SMS for a user Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_add_otpsms_request [BetaUserServiceAddOTPSMSRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceAddOTPSMSResponse] + def add_otpsms(beta_user_service_add_otpsms_request, opts = {}) + data, _status_code, _headers = add_otpsms_with_http_info(beta_user_service_add_otpsms_request, opts) + data + end + + # AddOTPSMS + # Add OTP SMS for a user Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_add_otpsms_request [BetaUserServiceAddOTPSMSRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceAddOTPSMSResponse, Integer, Hash)>] BetaUserServiceAddOTPSMSResponse data, response status code and response headers + def add_otpsms_with_http_info(beta_user_service_add_otpsms_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.add_otpsms ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_add_otpsms_request' is set + if @api_client.config.client_side_validation && beta_user_service_add_otpsms_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_add_otpsms_request' when calling Api::BetaUserServiceApi.add_otpsms" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/AddOTPSMS' + + # 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(beta_user_service_add_otpsms_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceAddOTPSMSResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.add_otpsms", # MODIFIED + :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: Api::BetaUserServiceApi#add_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # CreatePasskeyRegistrationLink + # Create a passkey registration link for a user Create a passkey registration link which includes a code and either return it or send it to the user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_create_passkey_registration_link_request [BetaUserServiceCreatePasskeyRegistrationLinkRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceCreatePasskeyRegistrationLinkResponse] + def create_passkey_registration_link(beta_user_service_create_passkey_registration_link_request, opts = {}) + data, _status_code, _headers = create_passkey_registration_link_with_http_info(beta_user_service_create_passkey_registration_link_request, opts) + data + end + + # CreatePasskeyRegistrationLink + # Create a passkey registration link for a user Create a passkey registration link which includes a code and either return it or send it to the user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_create_passkey_registration_link_request [BetaUserServiceCreatePasskeyRegistrationLinkRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceCreatePasskeyRegistrationLinkResponse, Integer, Hash)>] BetaUserServiceCreatePasskeyRegistrationLinkResponse data, response status code and response headers + def create_passkey_registration_link_with_http_info(beta_user_service_create_passkey_registration_link_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.create_passkey_registration_link ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_create_passkey_registration_link_request' is set + if @api_client.config.client_side_validation && beta_user_service_create_passkey_registration_link_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_create_passkey_registration_link_request' when calling Api::BetaUserServiceApi.create_passkey_registration_link" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/CreatePasskeyRegistrationLink' + + # 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(beta_user_service_create_passkey_registration_link_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceCreatePasskeyRegistrationLinkResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.create_passkey_registration_link", # MODIFIED + :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: Api::BetaUserServiceApi#create_passkey_registration_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # DeactivateUser + # Deactivate user The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_deactivate_user_request [BetaUserServiceDeactivateUserRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceDeactivateUserResponse] + def deactivate_user(beta_user_service_deactivate_user_request, opts = {}) + data, _status_code, _headers = deactivate_user_with_http_info(beta_user_service_deactivate_user_request, opts) + data + end + + # DeactivateUser + # Deactivate user The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_deactivate_user_request [BetaUserServiceDeactivateUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceDeactivateUserResponse, Integer, Hash)>] BetaUserServiceDeactivateUserResponse data, response status code and response headers + def deactivate_user_with_http_info(beta_user_service_deactivate_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.deactivate_user ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_deactivate_user_request' is set + if @api_client.config.client_side_validation && beta_user_service_deactivate_user_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_deactivate_user_request' when calling Api::BetaUserServiceApi.deactivate_user" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/DeactivateUser' + + # 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(beta_user_service_deactivate_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceDeactivateUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.deactivate_user", # MODIFIED + :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: Api::BetaUserServiceApi#deactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # DeleteUser + # Delete user The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_delete_user_request [BetaUserServiceDeleteUserRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceDeleteUserResponse] + def delete_user(beta_user_service_delete_user_request, opts = {}) + data, _status_code, _headers = delete_user_with_http_info(beta_user_service_delete_user_request, opts) + data + end + + # DeleteUser + # Delete user The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_delete_user_request [BetaUserServiceDeleteUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceDeleteUserResponse, Integer, Hash)>] BetaUserServiceDeleteUserResponse data, response status code and response headers + def delete_user_with_http_info(beta_user_service_delete_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.delete_user ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_delete_user_request' is set + if @api_client.config.client_side_validation && beta_user_service_delete_user_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_delete_user_request' when calling Api::BetaUserServiceApi.delete_user" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/DeleteUser' + + # 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(beta_user_service_delete_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceDeleteUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.delete_user", # MODIFIED + :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: Api::BetaUserServiceApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # GetUserByID + # User by ID Returns the full user object (human or machine) including the profile, email, etc. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_get_user_by_id_request [BetaUserServiceGetUserByIDRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceGetUserByIDResponse] + def get_user_by_id(beta_user_service_get_user_by_id_request, opts = {}) + data, _status_code, _headers = get_user_by_id_with_http_info(beta_user_service_get_user_by_id_request, opts) + data + end + + # GetUserByID + # User by ID Returns the full user object (human or machine) including the profile, email, etc. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_get_user_by_id_request [BetaUserServiceGetUserByIDRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceGetUserByIDResponse, Integer, Hash)>] BetaUserServiceGetUserByIDResponse data, response status code and response headers + def get_user_by_id_with_http_info(beta_user_service_get_user_by_id_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.get_user_by_id ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_get_user_by_id_request' is set + if @api_client.config.client_side_validation && beta_user_service_get_user_by_id_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_get_user_by_id_request' when calling Api::BetaUserServiceApi.get_user_by_id" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/GetUserByID' + + # 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(beta_user_service_get_user_by_id_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceGetUserByIDResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.get_user_by_id", # MODIFIED + :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: Api::BetaUserServiceApi#get_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListAuthenticationMethodTypes + # List all possible authentication methods of a user List all possible authentication methods of a user like password, passwordless, (T)OTP and more. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_list_authentication_method_types_request [BetaUserServiceListAuthenticationMethodTypesRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceListAuthenticationMethodTypesResponse] + def list_authentication_method_types(beta_user_service_list_authentication_method_types_request, opts = {}) + data, _status_code, _headers = list_authentication_method_types_with_http_info(beta_user_service_list_authentication_method_types_request, opts) + data + end + + # ListAuthenticationMethodTypes + # List all possible authentication methods of a user List all possible authentication methods of a user like password, passwordless, (T)OTP and more. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_list_authentication_method_types_request [BetaUserServiceListAuthenticationMethodTypesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceListAuthenticationMethodTypesResponse, Integer, Hash)>] BetaUserServiceListAuthenticationMethodTypesResponse data, response status code and response headers + def list_authentication_method_types_with_http_info(beta_user_service_list_authentication_method_types_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.list_authentication_method_types ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_list_authentication_method_types_request' is set + if @api_client.config.client_side_validation && beta_user_service_list_authentication_method_types_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_list_authentication_method_types_request' when calling Api::BetaUserServiceApi.list_authentication_method_types" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/ListAuthenticationMethodTypes' + + # 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(beta_user_service_list_authentication_method_types_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceListAuthenticationMethodTypesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.list_authentication_method_types", # MODIFIED + :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: Api::BetaUserServiceApi#list_authentication_method_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListUsers + # Search Users Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_list_users_request [BetaUserServiceListUsersRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceListUsersResponse] + def list_users(beta_user_service_list_users_request, opts = {}) + data, _status_code, _headers = list_users_with_http_info(beta_user_service_list_users_request, opts) + data + end + + # ListUsers + # Search Users Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_list_users_request [BetaUserServiceListUsersRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceListUsersResponse, Integer, Hash)>] BetaUserServiceListUsersResponse data, response status code and response headers + def list_users_with_http_info(beta_user_service_list_users_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.list_users ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_list_users_request' is set + if @api_client.config.client_side_validation && beta_user_service_list_users_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_list_users_request' when calling Api::BetaUserServiceApi.list_users" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/ListUsers' + + # 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(beta_user_service_list_users_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceListUsersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.list_users", # MODIFIED + :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: Api::BetaUserServiceApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # LockUser + # Lock user The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_lock_user_request [BetaUserServiceLockUserRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceLockUserResponse] + def lock_user(beta_user_service_lock_user_request, opts = {}) + data, _status_code, _headers = lock_user_with_http_info(beta_user_service_lock_user_request, opts) + data + end + + # LockUser + # Lock user The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_lock_user_request [BetaUserServiceLockUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceLockUserResponse, Integer, Hash)>] BetaUserServiceLockUserResponse data, response status code and response headers + def lock_user_with_http_info(beta_user_service_lock_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.lock_user ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_lock_user_request' is set + if @api_client.config.client_side_validation && beta_user_service_lock_user_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_lock_user_request' when calling Api::BetaUserServiceApi.lock_user" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/LockUser' + + # 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(beta_user_service_lock_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceLockUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.lock_user", # MODIFIED + :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: Api::BetaUserServiceApi#lock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # PasswordReset + # Request a code to reset a password Request a code to reset a password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_password_reset_request [BetaUserServicePasswordResetRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServicePasswordResetResponse] + def password_reset(beta_user_service_password_reset_request, opts = {}) + data, _status_code, _headers = password_reset_with_http_info(beta_user_service_password_reset_request, opts) + data + end + + # PasswordReset + # Request a code to reset a password Request a code to reset a password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_password_reset_request [BetaUserServicePasswordResetRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServicePasswordResetResponse, Integer, Hash)>] BetaUserServicePasswordResetResponse data, response status code and response headers + def password_reset_with_http_info(beta_user_service_password_reset_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.password_reset ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_password_reset_request' is set + if @api_client.config.client_side_validation && beta_user_service_password_reset_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_password_reset_request' when calling Api::BetaUserServiceApi.password_reset" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/PasswordReset' + + # 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(beta_user_service_password_reset_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServicePasswordResetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.password_reset", # MODIFIED + :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: Api::BetaUserServiceApi#password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ReactivateUser + # Reactivate user Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_reactivate_user_request [BetaUserServiceReactivateUserRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceReactivateUserResponse] + def reactivate_user(beta_user_service_reactivate_user_request, opts = {}) + data, _status_code, _headers = reactivate_user_with_http_info(beta_user_service_reactivate_user_request, opts) + data + end + + # ReactivateUser + # Reactivate user Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_reactivate_user_request [BetaUserServiceReactivateUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceReactivateUserResponse, Integer, Hash)>] BetaUserServiceReactivateUserResponse data, response status code and response headers + def reactivate_user_with_http_info(beta_user_service_reactivate_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.reactivate_user ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_reactivate_user_request' is set + if @api_client.config.client_side_validation && beta_user_service_reactivate_user_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_reactivate_user_request' when calling Api::BetaUserServiceApi.reactivate_user" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/ReactivateUser' + + # 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(beta_user_service_reactivate_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceReactivateUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.reactivate_user", # MODIFIED + :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: Api::BetaUserServiceApi#reactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # RegisterPasskey + # Start the registration of passkey for a user Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_register_passkey_request [BetaUserServiceRegisterPasskeyRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceRegisterPasskeyResponse] + def register_passkey(beta_user_service_register_passkey_request, opts = {}) + data, _status_code, _headers = register_passkey_with_http_info(beta_user_service_register_passkey_request, opts) + data + end + + # RegisterPasskey + # Start the registration of passkey for a user Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_register_passkey_request [BetaUserServiceRegisterPasskeyRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceRegisterPasskeyResponse, Integer, Hash)>] BetaUserServiceRegisterPasskeyResponse data, response status code and response headers + def register_passkey_with_http_info(beta_user_service_register_passkey_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.register_passkey ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_register_passkey_request' is set + if @api_client.config.client_side_validation && beta_user_service_register_passkey_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_register_passkey_request' when calling Api::BetaUserServiceApi.register_passkey" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/RegisterPasskey' + + # 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(beta_user_service_register_passkey_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceRegisterPasskeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.register_passkey", # MODIFIED + :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: Api::BetaUserServiceApi#register_passkey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # RegisterTOTP + # Start the registration of a TOTP generator for a user Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_register_totp_request [BetaUserServiceRegisterTOTPRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceRegisterTOTPResponse] + def register_totp(beta_user_service_register_totp_request, opts = {}) + data, _status_code, _headers = register_totp_with_http_info(beta_user_service_register_totp_request, opts) + data + end + + # RegisterTOTP + # Start the registration of a TOTP generator for a user Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_register_totp_request [BetaUserServiceRegisterTOTPRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceRegisterTOTPResponse, Integer, Hash)>] BetaUserServiceRegisterTOTPResponse data, response status code and response headers + def register_totp_with_http_info(beta_user_service_register_totp_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.register_totp ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_register_totp_request' is set + if @api_client.config.client_side_validation && beta_user_service_register_totp_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_register_totp_request' when calling Api::BetaUserServiceApi.register_totp" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/RegisterTOTP' + + # 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(beta_user_service_register_totp_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceRegisterTOTPResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.register_totp", # MODIFIED + :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: Api::BetaUserServiceApi#register_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # RegisterU2F + # Start the registration of a u2f token for a user Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_register_u2_f_request [BetaUserServiceRegisterU2FRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceRegisterU2FResponse] + def register_u2_f(beta_user_service_register_u2_f_request, opts = {}) + data, _status_code, _headers = register_u2_f_with_http_info(beta_user_service_register_u2_f_request, opts) + data + end + + # RegisterU2F + # Start the registration of a u2f token for a user Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_register_u2_f_request [BetaUserServiceRegisterU2FRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceRegisterU2FResponse, Integer, Hash)>] BetaUserServiceRegisterU2FResponse data, response status code and response headers + def register_u2_f_with_http_info(beta_user_service_register_u2_f_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.register_u2_f ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_register_u2_f_request' is set + if @api_client.config.client_side_validation && beta_user_service_register_u2_f_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_register_u2_f_request' when calling Api::BetaUserServiceApi.register_u2_f" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/RegisterU2F' + + # 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(beta_user_service_register_u2_f_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceRegisterU2FResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.register_u2_f", # MODIFIED + :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: Api::BetaUserServiceApi#register_u2_f\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # RemoveOTPEmail + # Remove One-Time Password (OTP) Email from a user Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_remove_otp_email_request [BetaUserServiceRemoveOTPEmailRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceRemoveOTPEmailResponse] + def remove_otp_email(beta_user_service_remove_otp_email_request, opts = {}) + data, _status_code, _headers = remove_otp_email_with_http_info(beta_user_service_remove_otp_email_request, opts) + data + end + + # RemoveOTPEmail + # Remove One-Time Password (OTP) Email from a user Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_remove_otp_email_request [BetaUserServiceRemoveOTPEmailRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceRemoveOTPEmailResponse, Integer, Hash)>] BetaUserServiceRemoveOTPEmailResponse data, response status code and response headers + def remove_otp_email_with_http_info(beta_user_service_remove_otp_email_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.remove_otp_email ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_remove_otp_email_request' is set + if @api_client.config.client_side_validation && beta_user_service_remove_otp_email_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_remove_otp_email_request' when calling Api::BetaUserServiceApi.remove_otp_email" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/RemoveOTPEmail' + + # 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(beta_user_service_remove_otp_email_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceRemoveOTPEmailResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.remove_otp_email", # MODIFIED + :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: Api::BetaUserServiceApi#remove_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # RemoveOTPSMS + # Remove One-Time Password (OTP) SMS from a user Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_remove_otpsms_request [BetaUserServiceRemoveOTPSMSRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceRemoveOTPSMSResponse] + def remove_otpsms(beta_user_service_remove_otpsms_request, opts = {}) + data, _status_code, _headers = remove_otpsms_with_http_info(beta_user_service_remove_otpsms_request, opts) + data + end + + # RemoveOTPSMS + # Remove One-Time Password (OTP) SMS from a user Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_remove_otpsms_request [BetaUserServiceRemoveOTPSMSRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceRemoveOTPSMSResponse, Integer, Hash)>] BetaUserServiceRemoveOTPSMSResponse data, response status code and response headers + def remove_otpsms_with_http_info(beta_user_service_remove_otpsms_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.remove_otpsms ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_remove_otpsms_request' is set + if @api_client.config.client_side_validation && beta_user_service_remove_otpsms_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_remove_otpsms_request' when calling Api::BetaUserServiceApi.remove_otpsms" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/RemoveOTPSMS' + + # 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(beta_user_service_remove_otpsms_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceRemoveOTPSMSResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.remove_otpsms", # MODIFIED + :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: Api::BetaUserServiceApi#remove_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # RemovePhone + # Remove the user phone Remove the user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_remove_phone_request [BetaUserServiceRemovePhoneRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceRemovePhoneResponse] + def remove_phone(beta_user_service_remove_phone_request, opts = {}) + data, _status_code, _headers = remove_phone_with_http_info(beta_user_service_remove_phone_request, opts) + data + end + + # RemovePhone + # Remove the user phone Remove the user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_remove_phone_request [BetaUserServiceRemovePhoneRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceRemovePhoneResponse, Integer, Hash)>] BetaUserServiceRemovePhoneResponse data, response status code and response headers + def remove_phone_with_http_info(beta_user_service_remove_phone_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.remove_phone ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_remove_phone_request' is set + if @api_client.config.client_side_validation && beta_user_service_remove_phone_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_remove_phone_request' when calling Api::BetaUserServiceApi.remove_phone" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/RemovePhone' + + # 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(beta_user_service_remove_phone_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceRemovePhoneResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.remove_phone", # MODIFIED + :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: Api::BetaUserServiceApi#remove_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # RemoveTOTP + # Remove TOTP generator from a user Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_remove_totp_request [BetaUserServiceRemoveTOTPRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceRemoveTOTPResponse] + def remove_totp(beta_user_service_remove_totp_request, opts = {}) + data, _status_code, _headers = remove_totp_with_http_info(beta_user_service_remove_totp_request, opts) + data + end + + # RemoveTOTP + # Remove TOTP generator from a user Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_remove_totp_request [BetaUserServiceRemoveTOTPRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceRemoveTOTPResponse, Integer, Hash)>] BetaUserServiceRemoveTOTPResponse data, response status code and response headers + def remove_totp_with_http_info(beta_user_service_remove_totp_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.remove_totp ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_remove_totp_request' is set + if @api_client.config.client_side_validation && beta_user_service_remove_totp_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_remove_totp_request' when calling Api::BetaUserServiceApi.remove_totp" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/RemoveTOTP' + + # 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(beta_user_service_remove_totp_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceRemoveTOTPResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.remove_totp", # MODIFIED + :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: Api::BetaUserServiceApi#remove_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ResendEmailCode + # Resend code to verify user email Resend code to verify user email Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_resend_email_code_request [BetaUserServiceResendEmailCodeRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceResendEmailCodeResponse] + def resend_email_code(beta_user_service_resend_email_code_request, opts = {}) + data, _status_code, _headers = resend_email_code_with_http_info(beta_user_service_resend_email_code_request, opts) + data + end + + # ResendEmailCode + # Resend code to verify user email Resend code to verify user email Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_resend_email_code_request [BetaUserServiceResendEmailCodeRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceResendEmailCodeResponse, Integer, Hash)>] BetaUserServiceResendEmailCodeResponse data, response status code and response headers + def resend_email_code_with_http_info(beta_user_service_resend_email_code_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.resend_email_code ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_resend_email_code_request' is set + if @api_client.config.client_side_validation && beta_user_service_resend_email_code_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_resend_email_code_request' when calling Api::BetaUserServiceApi.resend_email_code" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/ResendEmailCode' + + # 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(beta_user_service_resend_email_code_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceResendEmailCodeResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.resend_email_code", # MODIFIED + :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: Api::BetaUserServiceApi#resend_email_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ResendPhoneCode + # Resend code to verify user phone Resend code to verify user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_resend_phone_code_request [BetaUserServiceResendPhoneCodeRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceResendPhoneCodeResponse] + def resend_phone_code(beta_user_service_resend_phone_code_request, opts = {}) + data, _status_code, _headers = resend_phone_code_with_http_info(beta_user_service_resend_phone_code_request, opts) + data + end + + # ResendPhoneCode + # Resend code to verify user phone Resend code to verify user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_resend_phone_code_request [BetaUserServiceResendPhoneCodeRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceResendPhoneCodeResponse, Integer, Hash)>] BetaUserServiceResendPhoneCodeResponse data, response status code and response headers + def resend_phone_code_with_http_info(beta_user_service_resend_phone_code_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.resend_phone_code ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_resend_phone_code_request' is set + if @api_client.config.client_side_validation && beta_user_service_resend_phone_code_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_resend_phone_code_request' when calling Api::BetaUserServiceApi.resend_phone_code" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/ResendPhoneCode' + + # 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(beta_user_service_resend_phone_code_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceResendPhoneCodeResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.resend_phone_code", # MODIFIED + :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: Api::BetaUserServiceApi#resend_phone_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # RetrieveIdentityProviderIntent + # Retrieve the information returned by the identity provider Retrieve the information returned by the identity provider for registration or updating an existing user with new information. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_retrieve_identity_provider_intent_request [BetaUserServiceRetrieveIdentityProviderIntentRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceRetrieveIdentityProviderIntentResponse] + def retrieve_identity_provider_intent(beta_user_service_retrieve_identity_provider_intent_request, opts = {}) + data, _status_code, _headers = retrieve_identity_provider_intent_with_http_info(beta_user_service_retrieve_identity_provider_intent_request, opts) + data + end + + # RetrieveIdentityProviderIntent + # Retrieve the information returned by the identity provider Retrieve the information returned by the identity provider for registration or updating an existing user with new information. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_retrieve_identity_provider_intent_request [BetaUserServiceRetrieveIdentityProviderIntentRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceRetrieveIdentityProviderIntentResponse, Integer, Hash)>] BetaUserServiceRetrieveIdentityProviderIntentResponse data, response status code and response headers + def retrieve_identity_provider_intent_with_http_info(beta_user_service_retrieve_identity_provider_intent_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.retrieve_identity_provider_intent ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_retrieve_identity_provider_intent_request' is set + if @api_client.config.client_side_validation && beta_user_service_retrieve_identity_provider_intent_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_retrieve_identity_provider_intent_request' when calling Api::BetaUserServiceApi.retrieve_identity_provider_intent" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/RetrieveIdentityProviderIntent' + + # 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(beta_user_service_retrieve_identity_provider_intent_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceRetrieveIdentityProviderIntentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.retrieve_identity_provider_intent", # MODIFIED + :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: Api::BetaUserServiceApi#retrieve_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetEmail + # Change the user email Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_set_email_request [BetaUserServiceSetEmailRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceSetEmailResponse] + def set_email(beta_user_service_set_email_request, opts = {}) + data, _status_code, _headers = set_email_with_http_info(beta_user_service_set_email_request, opts) + data + end + + # SetEmail + # Change the user email Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_set_email_request [BetaUserServiceSetEmailRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceSetEmailResponse, Integer, Hash)>] BetaUserServiceSetEmailResponse data, response status code and response headers + def set_email_with_http_info(beta_user_service_set_email_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.set_email ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_set_email_request' is set + if @api_client.config.client_side_validation && beta_user_service_set_email_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_set_email_request' when calling Api::BetaUserServiceApi.set_email" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/SetEmail' + + # 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(beta_user_service_set_email_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceSetEmailResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.set_email", # MODIFIED + :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: Api::BetaUserServiceApi#set_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetPassword + # Change password Change the password of a user with either a verification code or the current password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_set_password_request [BetaUserServiceSetPasswordRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceSetPasswordResponse] + def set_password(beta_user_service_set_password_request, opts = {}) + data, _status_code, _headers = set_password_with_http_info(beta_user_service_set_password_request, opts) + data + end + + # SetPassword + # Change password Change the password of a user with either a verification code or the current password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_set_password_request [BetaUserServiceSetPasswordRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceSetPasswordResponse, Integer, Hash)>] BetaUserServiceSetPasswordResponse data, response status code and response headers + def set_password_with_http_info(beta_user_service_set_password_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.set_password ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_set_password_request' is set + if @api_client.config.client_side_validation && beta_user_service_set_password_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_set_password_request' when calling Api::BetaUserServiceApi.set_password" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/SetPassword' + + # 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(beta_user_service_set_password_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceSetPasswordResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.set_password", # MODIFIED + :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: Api::BetaUserServiceApi#set_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # SetPhone + # Set the user phone Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_set_phone_request [BetaUserServiceSetPhoneRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceSetPhoneResponse] + def set_phone(beta_user_service_set_phone_request, opts = {}) + data, _status_code, _headers = set_phone_with_http_info(beta_user_service_set_phone_request, opts) + data + end + + # SetPhone + # Set the user phone Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_set_phone_request [BetaUserServiceSetPhoneRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceSetPhoneResponse, Integer, Hash)>] BetaUserServiceSetPhoneResponse data, response status code and response headers + def set_phone_with_http_info(beta_user_service_set_phone_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.set_phone ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_set_phone_request' is set + if @api_client.config.client_side_validation && beta_user_service_set_phone_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_set_phone_request' when calling Api::BetaUserServiceApi.set_phone" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/SetPhone' + + # 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(beta_user_service_set_phone_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceSetPhoneResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.set_phone", # MODIFIED + :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: Api::BetaUserServiceApi#set_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # StartIdentityProviderIntent + # Start flow with an identity provider Start a flow with an identity provider, for external login, registration or linking. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_start_identity_provider_intent_request [BetaUserServiceStartIdentityProviderIntentRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceStartIdentityProviderIntentResponse] + def start_identity_provider_intent(beta_user_service_start_identity_provider_intent_request, opts = {}) + data, _status_code, _headers = start_identity_provider_intent_with_http_info(beta_user_service_start_identity_provider_intent_request, opts) + data + end + + # StartIdentityProviderIntent + # Start flow with an identity provider Start a flow with an identity provider, for external login, registration or linking. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_start_identity_provider_intent_request [BetaUserServiceStartIdentityProviderIntentRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceStartIdentityProviderIntentResponse, Integer, Hash)>] BetaUserServiceStartIdentityProviderIntentResponse data, response status code and response headers + def start_identity_provider_intent_with_http_info(beta_user_service_start_identity_provider_intent_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.start_identity_provider_intent ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_start_identity_provider_intent_request' is set + if @api_client.config.client_side_validation && beta_user_service_start_identity_provider_intent_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_start_identity_provider_intent_request' when calling Api::BetaUserServiceApi.start_identity_provider_intent" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/StartIdentityProviderIntent' + + # 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(beta_user_service_start_identity_provider_intent_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceStartIdentityProviderIntentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.start_identity_provider_intent", # MODIFIED + :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: Api::BetaUserServiceApi#start_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # UnlockUser + # Unlock user The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_unlock_user_request [BetaUserServiceUnlockUserRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceUnlockUserResponse] + def unlock_user(beta_user_service_unlock_user_request, opts = {}) + data, _status_code, _headers = unlock_user_with_http_info(beta_user_service_unlock_user_request, opts) + data + end + + # UnlockUser + # Unlock user The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_unlock_user_request [BetaUserServiceUnlockUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceUnlockUserResponse, Integer, Hash)>] BetaUserServiceUnlockUserResponse data, response status code and response headers + def unlock_user_with_http_info(beta_user_service_unlock_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.unlock_user ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_unlock_user_request' is set + if @api_client.config.client_side_validation && beta_user_service_unlock_user_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_unlock_user_request' when calling Api::BetaUserServiceApi.unlock_user" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/UnlockUser' + + # 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(beta_user_service_unlock_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceUnlockUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.unlock_user", # MODIFIED + :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: Api::BetaUserServiceApi#unlock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # UpdateHumanUser + # Update User Update all information from a user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_update_human_user_request [BetaUserServiceUpdateHumanUserRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceUpdateHumanUserResponse] + def update_human_user(beta_user_service_update_human_user_request, opts = {}) + data, _status_code, _headers = update_human_user_with_http_info(beta_user_service_update_human_user_request, opts) + data + end + + # UpdateHumanUser + # Update User Update all information from a user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_update_human_user_request [BetaUserServiceUpdateHumanUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceUpdateHumanUserResponse, Integer, Hash)>] BetaUserServiceUpdateHumanUserResponse data, response status code and response headers + def update_human_user_with_http_info(beta_user_service_update_human_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.update_human_user ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_update_human_user_request' is set + if @api_client.config.client_side_validation && beta_user_service_update_human_user_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_update_human_user_request' when calling Api::BetaUserServiceApi.update_human_user" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/UpdateHumanUser' + + # 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(beta_user_service_update_human_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceUpdateHumanUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.update_human_user", # MODIFIED + :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: Api::BetaUserServiceApi#update_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # VerifyEmail + # Verify the email Verify the email with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_email_request [BetaUserServiceVerifyEmailRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceVerifyEmailResponse] + def verify_email(beta_user_service_verify_email_request, opts = {}) + data, _status_code, _headers = verify_email_with_http_info(beta_user_service_verify_email_request, opts) + data + end + + # VerifyEmail + # Verify the email Verify the email with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_email_request [BetaUserServiceVerifyEmailRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceVerifyEmailResponse, Integer, Hash)>] BetaUserServiceVerifyEmailResponse data, response status code and response headers + def verify_email_with_http_info(beta_user_service_verify_email_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_email ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_verify_email_request' is set + if @api_client.config.client_side_validation && beta_user_service_verify_email_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_email_request' when calling Api::BetaUserServiceApi.verify_email" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/VerifyEmail' + + # 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(beta_user_service_verify_email_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyEmailResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.verify_email", # MODIFIED + :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: Api::BetaUserServiceApi#verify_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # VerifyPasskeyRegistration + # Verify a passkey for a user Verify the passkey registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_passkey_registration_request [BetaUserServiceVerifyPasskeyRegistrationRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceVerifyPasskeyRegistrationResponse] + def verify_passkey_registration(beta_user_service_verify_passkey_registration_request, opts = {}) + data, _status_code, _headers = verify_passkey_registration_with_http_info(beta_user_service_verify_passkey_registration_request, opts) + data + end + + # VerifyPasskeyRegistration + # Verify a passkey for a user Verify the passkey registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_passkey_registration_request [BetaUserServiceVerifyPasskeyRegistrationRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceVerifyPasskeyRegistrationResponse, Integer, Hash)>] BetaUserServiceVerifyPasskeyRegistrationResponse data, response status code and response headers + def verify_passkey_registration_with_http_info(beta_user_service_verify_passkey_registration_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_passkey_registration ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_verify_passkey_registration_request' is set + if @api_client.config.client_side_validation && beta_user_service_verify_passkey_registration_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_passkey_registration_request' when calling Api::BetaUserServiceApi.verify_passkey_registration" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/VerifyPasskeyRegistration' + + # 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(beta_user_service_verify_passkey_registration_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyPasskeyRegistrationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.verify_passkey_registration", # MODIFIED + :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: Api::BetaUserServiceApi#verify_passkey_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # VerifyPhone + # Verify the phone Verify the phone with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_phone_request [BetaUserServiceVerifyPhoneRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceVerifyPhoneResponse] + def verify_phone(beta_user_service_verify_phone_request, opts = {}) + data, _status_code, _headers = verify_phone_with_http_info(beta_user_service_verify_phone_request, opts) + data + end + + # VerifyPhone + # Verify the phone Verify the phone with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_phone_request [BetaUserServiceVerifyPhoneRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceVerifyPhoneResponse, Integer, Hash)>] BetaUserServiceVerifyPhoneResponse data, response status code and response headers + def verify_phone_with_http_info(beta_user_service_verify_phone_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_phone ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_verify_phone_request' is set + if @api_client.config.client_side_validation && beta_user_service_verify_phone_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_phone_request' when calling Api::BetaUserServiceApi.verify_phone" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/VerifyPhone' + + # 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(beta_user_service_verify_phone_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyPhoneResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.verify_phone", # MODIFIED + :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: Api::BetaUserServiceApi#verify_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # VerifyTOTPRegistration + # Verify a TOTP generator for a user Verify the TOTP registration with a generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_totp_registration_request [BetaUserServiceVerifyTOTPRegistrationRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceVerifyTOTPRegistrationResponse] + def verify_totp_registration(beta_user_service_verify_totp_registration_request, opts = {}) + data, _status_code, _headers = verify_totp_registration_with_http_info(beta_user_service_verify_totp_registration_request, opts) + data + end + + # VerifyTOTPRegistration + # Verify a TOTP generator for a user Verify the TOTP registration with a generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_totp_registration_request [BetaUserServiceVerifyTOTPRegistrationRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceVerifyTOTPRegistrationResponse, Integer, Hash)>] BetaUserServiceVerifyTOTPRegistrationResponse data, response status code and response headers + def verify_totp_registration_with_http_info(beta_user_service_verify_totp_registration_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_totp_registration ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_verify_totp_registration_request' is set + if @api_client.config.client_side_validation && beta_user_service_verify_totp_registration_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_totp_registration_request' when calling Api::BetaUserServiceApi.verify_totp_registration" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/VerifyTOTPRegistration' + + # 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(beta_user_service_verify_totp_registration_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyTOTPRegistrationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.verify_totp_registration", # MODIFIED + :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: Api::BetaUserServiceApi#verify_totp_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # VerifyU2FRegistration + # Verify a u2f token for a user Verify the u2f token registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_u2_f_registration_request [BetaUserServiceVerifyU2FRegistrationRequest] + # @param [Hash] opts the optional parameters + # @return [BetaUserServiceVerifyU2FRegistrationResponse] + def verify_u2_f_registration(beta_user_service_verify_u2_f_registration_request, opts = {}) + data, _status_code, _headers = verify_u2_f_registration_with_http_info(beta_user_service_verify_u2_f_registration_request, opts) + data + end + + # VerifyU2FRegistration + # Verify a u2f token for a user Verify the u2f token registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_verify_u2_f_registration_request [BetaUserServiceVerifyU2FRegistrationRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaUserServiceVerifyU2FRegistrationResponse, Integer, Hash)>] BetaUserServiceVerifyU2FRegistrationResponse data, response status code and response headers + def verify_u2_f_registration_with_http_info(beta_user_service_verify_u2_f_registration_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_u2_f_registration ...' # MODIFIED + end + # verify the required parameter 'beta_user_service_verify_u2_f_registration_request' is set + if @api_client.config.client_side_validation && beta_user_service_verify_u2_f_registration_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_u2_f_registration_request' when calling Api::BetaUserServiceApi.verify_u2_f_registration" # MODIFIED + end + # resource path + local_var_path = '/zitadel.user.v2beta.UserService/VerifyU2FRegistration' + + # 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(beta_user_service_verify_u2_f_registration_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyU2FRegistrationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaUserServiceApi.verify_u2_f_registration", # MODIFIED + :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: Api::BetaUserServiceApi#verify_u2_f_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + end +end diff --git a/lib/zitadel/client/api/beta_web_key_service_api.rb b/lib/zitadel/client/api/beta_web_key_service_api.rb new file mode 100644 index 00000000..e6caeefd --- /dev/null +++ b/lib/zitadel/client/api/beta_web_key_service_api.rb @@ -0,0 +1,294 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'cgi' + +module Zitadel::Client::Api + class BetaWebKeyServiceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # ActivateWebKey + # Activate Web Key Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` + # @param beta_web_key_service_activate_web_key_request [BetaWebKeyServiceActivateWebKeyRequest] + # @param [Hash] opts the optional parameters + # @return [BetaWebKeyServiceActivateWebKeyResponse] + def activate_web_key(beta_web_key_service_activate_web_key_request, opts = {}) + data, _status_code, _headers = activate_web_key_with_http_info(beta_web_key_service_activate_web_key_request, opts) + data + end + + # ActivateWebKey + # Activate Web Key Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` + # @param beta_web_key_service_activate_web_key_request [BetaWebKeyServiceActivateWebKeyRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaWebKeyServiceActivateWebKeyResponse, Integer, Hash)>] BetaWebKeyServiceActivateWebKeyResponse data, response status code and response headers + def activate_web_key_with_http_info(beta_web_key_service_activate_web_key_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaWebKeyServiceApi.activate_web_key ...' # MODIFIED + end + # verify the required parameter 'beta_web_key_service_activate_web_key_request' is set + if @api_client.config.client_side_validation && beta_web_key_service_activate_web_key_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_web_key_service_activate_web_key_request' when calling Api::BetaWebKeyServiceApi.activate_web_key" # MODIFIED + end + # resource path + local_var_path = '/zitadel.webkey.v2beta.WebKeyService/ActivateWebKey' + + # 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(beta_web_key_service_activate_web_key_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaWebKeyServiceActivateWebKeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaWebKeyServiceApi.activate_web_key", # MODIFIED + :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: Api::BetaWebKeyServiceApi#activate_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # CreateWebKey + # Create Web Key Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` + # @param beta_web_key_service_create_web_key_request [BetaWebKeyServiceCreateWebKeyRequest] + # @param [Hash] opts the optional parameters + # @return [BetaWebKeyServiceCreateWebKeyResponse] + def create_web_key(beta_web_key_service_create_web_key_request, opts = {}) + data, _status_code, _headers = create_web_key_with_http_info(beta_web_key_service_create_web_key_request, opts) + data + end + + # CreateWebKey + # Create Web Key Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` + # @param beta_web_key_service_create_web_key_request [BetaWebKeyServiceCreateWebKeyRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaWebKeyServiceCreateWebKeyResponse, Integer, Hash)>] BetaWebKeyServiceCreateWebKeyResponse data, response status code and response headers + def create_web_key_with_http_info(beta_web_key_service_create_web_key_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaWebKeyServiceApi.create_web_key ...' # MODIFIED + end + # verify the required parameter 'beta_web_key_service_create_web_key_request' is set + if @api_client.config.client_side_validation && beta_web_key_service_create_web_key_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_web_key_service_create_web_key_request' when calling Api::BetaWebKeyServiceApi.create_web_key" # MODIFIED + end + # resource path + local_var_path = '/zitadel.webkey.v2beta.WebKeyService/CreateWebKey' + + # 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(beta_web_key_service_create_web_key_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaWebKeyServiceCreateWebKeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaWebKeyServiceApi.create_web_key", # MODIFIED + :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: Api::BetaWebKeyServiceApi#create_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # DeleteWebKey + # Delete Web Key Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` Required feature flag: - `web_key` + # @param beta_web_key_service_delete_web_key_request [BetaWebKeyServiceDeleteWebKeyRequest] + # @param [Hash] opts the optional parameters + # @return [BetaWebKeyServiceDeleteWebKeyResponse] + def delete_web_key(beta_web_key_service_delete_web_key_request, opts = {}) + data, _status_code, _headers = delete_web_key_with_http_info(beta_web_key_service_delete_web_key_request, opts) + data + end + + # DeleteWebKey + # Delete Web Key Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` Required feature flag: - `web_key` + # @param beta_web_key_service_delete_web_key_request [BetaWebKeyServiceDeleteWebKeyRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaWebKeyServiceDeleteWebKeyResponse, Integer, Hash)>] BetaWebKeyServiceDeleteWebKeyResponse data, response status code and response headers + def delete_web_key_with_http_info(beta_web_key_service_delete_web_key_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaWebKeyServiceApi.delete_web_key ...' # MODIFIED + end + # verify the required parameter 'beta_web_key_service_delete_web_key_request' is set + if @api_client.config.client_side_validation && beta_web_key_service_delete_web_key_request.nil? + fail ArgumentError, "Missing the required parameter 'beta_web_key_service_delete_web_key_request' when calling Api::BetaWebKeyServiceApi.delete_web_key" # MODIFIED + end + # resource path + local_var_path = '/zitadel.webkey.v2beta.WebKeyService/DeleteWebKey' + + # 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(beta_web_key_service_delete_web_key_request) + + # return_type + return_type = opts[:debug_return_type] || 'BetaWebKeyServiceDeleteWebKeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaWebKeyServiceApi.delete_web_key", # MODIFIED + :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: Api::BetaWebKeyServiceApi#delete_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + + # ListWebKeys + # List Web Keys List all web keys and their states. Required permission: - `iam.web_key.read` Required feature flag: - `web_key` + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [BetaWebKeyServiceListWebKeysResponse] + def list_web_keys(body, opts = {}) + data, _status_code, _headers = list_web_keys_with_http_info(body, opts) + data + end + + # ListWebKeys + # List Web Keys List all web keys and their states. Required permission: - `iam.web_key.read` Required feature flag: - `web_key` + # @param body [Object] + # @param [Hash] opts the optional parameters + # @return [Array<(BetaWebKeyServiceListWebKeysResponse, Integer, Hash)>] BetaWebKeyServiceListWebKeysResponse data, response status code and response headers + def list_web_keys_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::BetaWebKeyServiceApi.list_web_keys ...' # MODIFIED + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaWebKeyServiceApi.list_web_keys" # MODIFIED + end + # resource path + local_var_path = '/zitadel.webkey.v2beta.WebKeyService/ListWebKeys' + + # 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(body) + + # return_type + return_type = opts[:debug_return_type] || 'BetaWebKeyServiceListWebKeysResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::BetaWebKeyServiceApi.list_web_keys", # MODIFIED + :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: Api::BetaWebKeyServiceApi#list_web_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + end + return data, status_code, headers + end + end +end diff --git a/lib/zitadel/client/api/feature_service_api.rb b/lib/zitadel/client/api/feature_service_api.rb index 196dc15e..2aaab091 100644 --- a/lib/zitadel/client/api/feature_service_api.rb +++ b/lib/zitadel/client/api/feature_service_api.rb @@ -19,42 +19,50 @@ class FeatureServiceApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Get Instance Features - # Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none + # GetInstanceFeatures + # Get Instance Features Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none + # @param feature_service_get_instance_features_request [FeatureServiceGetInstanceFeaturesRequest] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :inheritance Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the instance, it will be omitted from the response or Not Found is returned when the instance has no features flags at all. # @return [FeatureServiceGetInstanceFeaturesResponse] - def feature_service_get_instance_features(opts = {}) - data, _status_code, _headers = feature_service_get_instance_features_with_http_info(opts) + def get_instance_features(feature_service_get_instance_features_request, opts = {}) + data, _status_code, _headers = get_instance_features_with_http_info(feature_service_get_instance_features_request, opts) data end - # Get Instance Features - # Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none + # GetInstanceFeatures + # Get Instance Features Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none + # @param feature_service_get_instance_features_request [FeatureServiceGetInstanceFeaturesRequest] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :inheritance Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the instance, it will be omitted from the response or Not Found is returned when the instance has no features flags at all. # @return [Array<(FeatureServiceGetInstanceFeaturesResponse, Integer, Hash)>] FeatureServiceGetInstanceFeaturesResponse data, response status code and response headers - def feature_service_get_instance_features_with_http_info(opts = {}) + def get_instance_features_with_http_info(feature_service_get_instance_features_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_get_instance_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.get_instance_features ...' # MODIFIED end + # verify the required parameter 'feature_service_get_instance_features_request' is set + if @api_client.config.client_side_validation && feature_service_get_instance_features_request.nil? + fail ArgumentError, "Missing the required parameter 'feature_service_get_instance_features_request' when calling Api::FeatureServiceApi.get_instance_features" # MODIFIED + end # resource path - local_var_path = '/v2/features/instance' + local_var_path = '/zitadel.feature.v2.FeatureService/GetInstanceFeatures' # query parameters query_params = opts[:query_params] || {} - query_params[:'inheritance'] = opts[:'inheritance'] if !opts[:'inheritance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_get_instance_features_request) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceGetInstanceFeaturesResponse' @@ -63,7 +71,7 @@ def feature_service_get_instance_features_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_get_instance_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.get_instance_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -72,55 +80,57 @@ def feature_service_get_instance_features_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_get_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#get_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Get Organization Features - # Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to - # @param organization_id [String] + # GetOrganizationFeatures + # Get Organization Features Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to + # @param feature_service_get_organization_features_request [FeatureServiceGetOrganizationFeaturesRequest] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :inheritance Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all. # @return [FeatureServiceGetOrganizationFeaturesResponse] - def feature_service_get_organization_features(organization_id, opts = {}) - data, _status_code, _headers = feature_service_get_organization_features_with_http_info(organization_id, opts) + def get_organization_features(feature_service_get_organization_features_request, opts = {}) + data, _status_code, _headers = get_organization_features_with_http_info(feature_service_get_organization_features_request, opts) data end - # Get Organization Features - # Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to - # @param organization_id [String] + # GetOrganizationFeatures + # Get Organization Features Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to + # @param feature_service_get_organization_features_request [FeatureServiceGetOrganizationFeaturesRequest] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :inheritance Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the organization, it will be omitted from the response or Not Found is returned when the organization has no features flags at all. # @return [Array<(FeatureServiceGetOrganizationFeaturesResponse, Integer, Hash)>] FeatureServiceGetOrganizationFeaturesResponse data, response status code and response headers - def feature_service_get_organization_features_with_http_info(organization_id, opts = {}) + def get_organization_features_with_http_info(feature_service_get_organization_features_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_get_organization_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.get_organization_features ...' # MODIFIED 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 Api::FeatureServiceApi.feature_service_get_organization_features" # MODIFIED + # verify the required parameter 'feature_service_get_organization_features_request' is set + if @api_client.config.client_side_validation && feature_service_get_organization_features_request.nil? + fail ArgumentError, "Missing the required parameter 'feature_service_get_organization_features_request' when calling Api::FeatureServiceApi.get_organization_features" # MODIFIED end # resource path - local_var_path = '/v2/features/organization/{organizationId}'.sub('{' + 'organizationId' + '}', CGI.escape(organization_id.to_s)) + local_var_path = '/zitadel.feature.v2.FeatureService/GetOrganizationFeatures' # query parameters query_params = opts[:query_params] || {} - query_params[:'inheritance'] = opts[:'inheritance'] if !opts[:'inheritance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_get_organization_features_request) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceGetOrganizationFeaturesResponse' @@ -129,7 +139,7 @@ def feature_service_get_organization_features_with_http_info(organization_id, op auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_get_organization_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.get_organization_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -138,32 +148,38 @@ def feature_service_get_organization_features_with_http_info(organization_id, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_get_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#get_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Get System Features - # Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + # GetSystemFeatures + # Get System Features Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + # @param body [Object] # @param [Hash] opts the optional parameters # @return [FeatureServiceGetSystemFeaturesResponse] - def feature_service_get_system_features(opts = {}) - data, _status_code, _headers = feature_service_get_system_features_with_http_info(opts) + def get_system_features(body, opts = {}) + data, _status_code, _headers = get_system_features_with_http_info(body, opts) data end - # Get System Features - # Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + # GetSystemFeatures + # Get System Features Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + # @param body [Object] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceGetSystemFeaturesResponse, Integer, Hash)>] FeatureServiceGetSystemFeaturesResponse data, response status code and response headers - def feature_service_get_system_features_with_http_info(opts = {}) + def get_system_features_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_get_system_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.get_system_features ...' # MODIFIED end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::FeatureServiceApi.get_system_features" # MODIFIED + end # resource path - local_var_path = '/v2/features/system' + local_var_path = '/zitadel.feature.v2.FeatureService/GetSystemFeatures' # query parameters query_params = opts[:query_params] || {} @@ -172,12 +188,17 @@ def feature_service_get_system_features_with_http_info(opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceGetSystemFeaturesResponse' @@ -186,7 +207,7 @@ def feature_service_get_system_features_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_get_system_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.get_system_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -195,55 +216,57 @@ def feature_service_get_system_features_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_get_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#get_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Get User Features - # Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user - # @param user_id [String] + # GetUserFeatures + # Get User Features Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user + # @param feature_service_get_user_features_request [FeatureServiceGetUserFeaturesRequest] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :inheritance Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all. # @return [FeatureServiceGetUserFeaturesResponse] - def feature_service_get_user_features(user_id, opts = {}) - data, _status_code, _headers = feature_service_get_user_features_with_http_info(user_id, opts) + def get_user_features(feature_service_get_user_features_request, opts = {}) + data, _status_code, _headers = get_user_features_with_http_info(feature_service_get_user_features_request, opts) data end - # Get User Features - # Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user - # @param user_id [String] + # GetUserFeatures + # Get User Features Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user + # @param feature_service_get_user_features_request [FeatureServiceGetUserFeaturesRequest] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :inheritance Inherit unset features from the resource owners. This option is recursive: if the flag is set, the resource's ancestors are consulted up to system defaults. If this option is disabled and the feature is not set on the user, it will be ommitted from the response or Not Found is returned when the user has no features flags at all. # @return [Array<(FeatureServiceGetUserFeaturesResponse, Integer, Hash)>] FeatureServiceGetUserFeaturesResponse data, response status code and response headers - def feature_service_get_user_features_with_http_info(user_id, opts = {}) + def get_user_features_with_http_info(feature_service_get_user_features_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_get_user_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.get_user_features ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::FeatureServiceApi.feature_service_get_user_features" # MODIFIED + # verify the required parameter 'feature_service_get_user_features_request' is set + if @api_client.config.client_side_validation && feature_service_get_user_features_request.nil? + fail ArgumentError, "Missing the required parameter 'feature_service_get_user_features_request' when calling Api::FeatureServiceApi.get_user_features" # MODIFIED end # resource path - local_var_path = '/v2/features/user/{userId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.feature.v2.FeatureService/GetUserFeatures' # query parameters query_params = opts[:query_params] || {} - query_params[:'inheritance'] = opts[:'inheritance'] if !opts[:'inheritance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_get_user_features_request) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceGetUserFeaturesResponse' @@ -252,7 +275,7 @@ def feature_service_get_user_features_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_get_user_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.get_user_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -261,32 +284,38 @@ def feature_service_get_user_features_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_get_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#get_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Reset Instance Features - # Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete + # ResetInstanceFeatures + # Reset Instance Features Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete + # @param body [Object] # @param [Hash] opts the optional parameters # @return [FeatureServiceResetInstanceFeaturesResponse] - def feature_service_reset_instance_features(opts = {}) - data, _status_code, _headers = feature_service_reset_instance_features_with_http_info(opts) + def reset_instance_features(body, opts = {}) + data, _status_code, _headers = reset_instance_features_with_http_info(body, opts) data end - # Reset Instance Features - # Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete + # ResetInstanceFeatures + # Reset Instance Features Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete + # @param body [Object] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceResetInstanceFeaturesResponse, Integer, Hash)>] FeatureServiceResetInstanceFeaturesResponse data, response status code and response headers - def feature_service_reset_instance_features_with_http_info(opts = {}) + def reset_instance_features_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_reset_instance_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.reset_instance_features ...' # MODIFIED end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::FeatureServiceApi.reset_instance_features" # MODIFIED + end # resource path - local_var_path = '/v2/features/instance' + local_var_path = '/zitadel.feature.v2.FeatureService/ResetInstanceFeatures' # query parameters query_params = opts[:query_params] || {} @@ -295,12 +324,17 @@ def feature_service_reset_instance_features_with_http_info(opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceResetInstanceFeaturesResponse' @@ -309,7 +343,7 @@ def feature_service_reset_instance_features_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_reset_instance_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.reset_instance_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -318,38 +352,38 @@ def feature_service_reset_instance_features_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_reset_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#reset_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Reset Organization Features - # Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete - # @param organization_id [String] + # ResetOrganizationFeatures + # Reset Organization Features Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete + # @param feature_service_reset_organization_features_request [FeatureServiceResetOrganizationFeaturesRequest] # @param [Hash] opts the optional parameters # @return [FeatureServiceResetOrganizationFeaturesResponse] - def feature_service_reset_organization_features(organization_id, opts = {}) - data, _status_code, _headers = feature_service_reset_organization_features_with_http_info(organization_id, opts) + def reset_organization_features(feature_service_reset_organization_features_request, opts = {}) + data, _status_code, _headers = reset_organization_features_with_http_info(feature_service_reset_organization_features_request, opts) data end - # Reset Organization Features - # Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete - # @param organization_id [String] + # ResetOrganizationFeatures + # Reset Organization Features Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete + # @param feature_service_reset_organization_features_request [FeatureServiceResetOrganizationFeaturesRequest] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceResetOrganizationFeaturesResponse, Integer, Hash)>] FeatureServiceResetOrganizationFeaturesResponse data, response status code and response headers - def feature_service_reset_organization_features_with_http_info(organization_id, opts = {}) + def reset_organization_features_with_http_info(feature_service_reset_organization_features_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_reset_organization_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.reset_organization_features ...' # MODIFIED 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 Api::FeatureServiceApi.feature_service_reset_organization_features" # MODIFIED + # verify the required parameter 'feature_service_reset_organization_features_request' is set + if @api_client.config.client_side_validation && feature_service_reset_organization_features_request.nil? + fail ArgumentError, "Missing the required parameter 'feature_service_reset_organization_features_request' when calling Api::FeatureServiceApi.reset_organization_features" # MODIFIED end # resource path - local_var_path = '/v2/features/organization/{organizationId}'.sub('{' + 'organizationId' + '}', CGI.escape(organization_id.to_s)) + local_var_path = '/zitadel.feature.v2.FeatureService/ResetOrganizationFeatures' # query parameters query_params = opts[:query_params] || {} @@ -358,12 +392,17 @@ def feature_service_reset_organization_features_with_http_info(organization_id, 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_reset_organization_features_request) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceResetOrganizationFeaturesResponse' @@ -372,7 +411,7 @@ def feature_service_reset_organization_features_with_http_info(organization_id, auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_reset_organization_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.reset_organization_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -381,32 +420,38 @@ def feature_service_reset_organization_features_with_http_info(organization_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_reset_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#reset_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Reset System Features - # Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete + # ResetSystemFeatures + # Reset System Features Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete + # @param body [Object] # @param [Hash] opts the optional parameters # @return [FeatureServiceResetSystemFeaturesResponse] - def feature_service_reset_system_features(opts = {}) - data, _status_code, _headers = feature_service_reset_system_features_with_http_info(opts) + def reset_system_features(body, opts = {}) + data, _status_code, _headers = reset_system_features_with_http_info(body, opts) data end - # Reset System Features - # Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete + # ResetSystemFeatures + # Reset System Features Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete + # @param body [Object] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceResetSystemFeaturesResponse, Integer, Hash)>] FeatureServiceResetSystemFeaturesResponse data, response status code and response headers - def feature_service_reset_system_features_with_http_info(opts = {}) + def reset_system_features_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_reset_system_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.reset_system_features ...' # MODIFIED end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::FeatureServiceApi.reset_system_features" # MODIFIED + end # resource path - local_var_path = '/v2/features/system' + local_var_path = '/zitadel.feature.v2.FeatureService/ResetSystemFeatures' # query parameters query_params = opts[:query_params] || {} @@ -415,12 +460,17 @@ def feature_service_reset_system_features_with_http_info(opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceResetSystemFeaturesResponse' @@ -429,7 +479,7 @@ def feature_service_reset_system_features_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_reset_system_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.reset_system_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -438,38 +488,38 @@ def feature_service_reset_system_features_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_reset_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#reset_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Reset User Features - # Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete - # @param user_id [String] + # ResetUserFeatures + # Reset User Features Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete + # @param feature_service_reset_user_features_request [FeatureServiceResetUserFeaturesRequest] # @param [Hash] opts the optional parameters # @return [FeatureServiceResetUserFeaturesResponse] - def feature_service_reset_user_features(user_id, opts = {}) - data, _status_code, _headers = feature_service_reset_user_features_with_http_info(user_id, opts) + def reset_user_features(feature_service_reset_user_features_request, opts = {}) + data, _status_code, _headers = reset_user_features_with_http_info(feature_service_reset_user_features_request, opts) data end - # Reset User Features - # Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete - # @param user_id [String] + # ResetUserFeatures + # Reset User Features Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete + # @param feature_service_reset_user_features_request [FeatureServiceResetUserFeaturesRequest] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceResetUserFeaturesResponse, Integer, Hash)>] FeatureServiceResetUserFeaturesResponse data, response status code and response headers - def feature_service_reset_user_features_with_http_info(user_id, opts = {}) + def reset_user_features_with_http_info(feature_service_reset_user_features_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_reset_user_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.reset_user_features ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::FeatureServiceApi.feature_service_reset_user_features" # MODIFIED + # verify the required parameter 'feature_service_reset_user_features_request' is set + if @api_client.config.client_side_validation && feature_service_reset_user_features_request.nil? + fail ArgumentError, "Missing the required parameter 'feature_service_reset_user_features_request' when calling Api::FeatureServiceApi.reset_user_features" # MODIFIED end # resource path - local_var_path = '/v2/features/user/{userId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.feature.v2.FeatureService/ResetUserFeatures' # query parameters query_params = opts[:query_params] || {} @@ -478,12 +528,17 @@ def feature_service_reset_user_features_with_http_info(user_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_reset_user_features_request) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceResetUserFeaturesResponse' @@ -492,7 +547,7 @@ def feature_service_reset_user_features_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_reset_user_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.reset_user_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -501,38 +556,38 @@ def feature_service_reset_user_features_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_reset_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#reset_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Set Instance Features - # Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write + # SetInstanceFeatures + # Set Instance Features Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write # @param feature_service_set_instance_features_request [FeatureServiceSetInstanceFeaturesRequest] # @param [Hash] opts the optional parameters # @return [FeatureServiceSetInstanceFeaturesResponse] - def feature_service_set_instance_features(feature_service_set_instance_features_request, opts = {}) - data, _status_code, _headers = feature_service_set_instance_features_with_http_info(feature_service_set_instance_features_request, opts) + def set_instance_features(feature_service_set_instance_features_request, opts = {}) + data, _status_code, _headers = set_instance_features_with_http_info(feature_service_set_instance_features_request, opts) data end - # Set Instance Features - # Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write + # SetInstanceFeatures + # Set Instance Features Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write # @param feature_service_set_instance_features_request [FeatureServiceSetInstanceFeaturesRequest] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceSetInstanceFeaturesResponse, Integer, Hash)>] FeatureServiceSetInstanceFeaturesResponse data, response status code and response headers - def feature_service_set_instance_features_with_http_info(feature_service_set_instance_features_request, opts = {}) + def set_instance_features_with_http_info(feature_service_set_instance_features_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_set_instance_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.set_instance_features ...' # MODIFIED end # verify the required parameter 'feature_service_set_instance_features_request' is set if @api_client.config.client_side_validation && feature_service_set_instance_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_set_instance_features_request' when calling Api::FeatureServiceApi.feature_service_set_instance_features" # MODIFIED + fail ArgumentError, "Missing the required parameter 'feature_service_set_instance_features_request' when calling Api::FeatureServiceApi.set_instance_features" # MODIFIED end # resource path - local_var_path = '/v2/features/instance' + local_var_path = '/zitadel.feature.v2.FeatureService/SetInstanceFeatures' # query parameters query_params = opts[:query_params] || {} @@ -560,7 +615,7 @@ def feature_service_set_instance_features_with_http_info(feature_service_set_ins auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_set_instance_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.set_instance_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -569,38 +624,38 @@ def feature_service_set_instance_features_with_http_info(feature_service_set_ins :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_set_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#set_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Set Organization Features - # Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write - # @param organization_id [String] + # SetOrganizationFeatures + # Set Organization Features Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write + # @param feature_service_set_organization_features_request [FeatureServiceSetOrganizationFeaturesRequest] # @param [Hash] opts the optional parameters # @return [FeatureServiceSetOrganizationFeaturesResponse] - def feature_service_set_organization_features(organization_id, opts = {}) - data, _status_code, _headers = feature_service_set_organization_features_with_http_info(organization_id, opts) + def set_organization_features(feature_service_set_organization_features_request, opts = {}) + data, _status_code, _headers = set_organization_features_with_http_info(feature_service_set_organization_features_request, opts) data end - # Set Organization Features - # Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write - # @param organization_id [String] + # SetOrganizationFeatures + # Set Organization Features Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write + # @param feature_service_set_organization_features_request [FeatureServiceSetOrganizationFeaturesRequest] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceSetOrganizationFeaturesResponse, Integer, Hash)>] FeatureServiceSetOrganizationFeaturesResponse data, response status code and response headers - def feature_service_set_organization_features_with_http_info(organization_id, opts = {}) + def set_organization_features_with_http_info(feature_service_set_organization_features_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_set_organization_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.set_organization_features ...' # MODIFIED 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 Api::FeatureServiceApi.feature_service_set_organization_features" # MODIFIED + # verify the required parameter 'feature_service_set_organization_features_request' is set + if @api_client.config.client_side_validation && feature_service_set_organization_features_request.nil? + fail ArgumentError, "Missing the required parameter 'feature_service_set_organization_features_request' when calling Api::FeatureServiceApi.set_organization_features" # MODIFIED end # resource path - local_var_path = '/v2/features/organization/{organizationId}'.sub('{' + 'organizationId' + '}', CGI.escape(organization_id.to_s)) + local_var_path = '/zitadel.feature.v2.FeatureService/SetOrganizationFeatures' # query parameters query_params = opts[:query_params] || {} @@ -619,7 +674,7 @@ def feature_service_set_organization_features_with_http_info(organization_id, op form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_set_organization_features_request) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceSetOrganizationFeaturesResponse' @@ -628,7 +683,7 @@ def feature_service_set_organization_features_with_http_info(organization_id, op auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_set_organization_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.set_organization_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -637,38 +692,38 @@ def feature_service_set_organization_features_with_http_info(organization_id, op :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_set_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#set_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Set System Features - # Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write + # SetSystemFeatures + # Set System Features Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write # @param feature_service_set_system_features_request [FeatureServiceSetSystemFeaturesRequest] # @param [Hash] opts the optional parameters # @return [FeatureServiceSetSystemFeaturesResponse] - def feature_service_set_system_features(feature_service_set_system_features_request, opts = {}) - data, _status_code, _headers = feature_service_set_system_features_with_http_info(feature_service_set_system_features_request, opts) + def set_system_features(feature_service_set_system_features_request, opts = {}) + data, _status_code, _headers = set_system_features_with_http_info(feature_service_set_system_features_request, opts) data end - # Set System Features - # Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write + # SetSystemFeatures + # Set System Features Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write # @param feature_service_set_system_features_request [FeatureServiceSetSystemFeaturesRequest] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceSetSystemFeaturesResponse, Integer, Hash)>] FeatureServiceSetSystemFeaturesResponse data, response status code and response headers - def feature_service_set_system_features_with_http_info(feature_service_set_system_features_request, opts = {}) + def set_system_features_with_http_info(feature_service_set_system_features_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_set_system_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.set_system_features ...' # MODIFIED end # verify the required parameter 'feature_service_set_system_features_request' is set if @api_client.config.client_side_validation && feature_service_set_system_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_set_system_features_request' when calling Api::FeatureServiceApi.feature_service_set_system_features" # MODIFIED + fail ArgumentError, "Missing the required parameter 'feature_service_set_system_features_request' when calling Api::FeatureServiceApi.set_system_features" # MODIFIED end # resource path - local_var_path = '/v2/features/system' + local_var_path = '/zitadel.feature.v2.FeatureService/SetSystemFeatures' # query parameters query_params = opts[:query_params] || {} @@ -696,7 +751,7 @@ def feature_service_set_system_features_with_http_info(feature_service_set_syste auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_set_system_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.set_system_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -705,38 +760,38 @@ def feature_service_set_system_features_with_http_info(feature_service_set_syste :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_set_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#set_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Set User Features - # Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write - # @param user_id [String] + # SetUserFeatures + # Set User Features Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write + # @param feature_service_set_user_feature_request [FeatureServiceSetUserFeatureRequest] # @param [Hash] opts the optional parameters # @return [FeatureServiceSetUserFeaturesResponse] - def feature_service_set_user_features(user_id, opts = {}) - data, _status_code, _headers = feature_service_set_user_features_with_http_info(user_id, opts) + def set_user_features(feature_service_set_user_feature_request, opts = {}) + data, _status_code, _headers = set_user_features_with_http_info(feature_service_set_user_feature_request, opts) data end - # Set User Features - # Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write - # @param user_id [String] + # SetUserFeatures + # Set User Features Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write + # @param feature_service_set_user_feature_request [FeatureServiceSetUserFeatureRequest] # @param [Hash] opts the optional parameters # @return [Array<(FeatureServiceSetUserFeaturesResponse, Integer, Hash)>] FeatureServiceSetUserFeaturesResponse data, response status code and response headers - def feature_service_set_user_features_with_http_info(user_id, opts = {}) + def set_user_features_with_http_info(feature_service_set_user_feature_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.feature_service_set_user_features ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.set_user_features ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::FeatureServiceApi.feature_service_set_user_features" # MODIFIED + # verify the required parameter 'feature_service_set_user_feature_request' is set + if @api_client.config.client_side_validation && feature_service_set_user_feature_request.nil? + fail ArgumentError, "Missing the required parameter 'feature_service_set_user_feature_request' when calling Api::FeatureServiceApi.set_user_features" # MODIFIED end # resource path - local_var_path = '/v2/features/user/{userId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.feature.v2.FeatureService/SetUserFeatures' # query parameters query_params = opts[:query_params] || {} @@ -755,7 +810,7 @@ def feature_service_set_user_features_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_set_user_feature_request) # return_type return_type = opts[:debug_return_type] || 'FeatureServiceSetUserFeaturesResponse' @@ -764,7 +819,7 @@ def feature_service_set_user_features_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.feature_service_set_user_features", # MODIFIED + :operation => :"Api::FeatureServiceApi.set_user_features", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -773,9 +828,9 @@ def feature_service_set_user_features_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + 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: Api::FeatureServiceApi#feature_service_set_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::FeatureServiceApi#set_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end diff --git a/lib/zitadel/client/api/identity_provider_service_api.rb b/lib/zitadel/client/api/identity_provider_service_api.rb index 422883f6..6266f8d5 100644 --- a/lib/zitadel/client/api/identity_provider_service_api.rb +++ b/lib/zitadel/client/api/identity_provider_service_api.rb @@ -19,31 +19,31 @@ class IdentityProviderServiceApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Get identity provider (IdP) by ID - # Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. - # @param id [String] + # GetIDPByID + # Get identity provider (IdP) by ID Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. + # @param identity_provider_service_get_idpby_id_request [IdentityProviderServiceGetIDPByIDRequest] # @param [Hash] opts the optional parameters # @return [IdentityProviderServiceGetIDPByIDResponse] - def identity_provider_service_get_idpby_id(id, opts = {}) - data, _status_code, _headers = identity_provider_service_get_idpby_id_with_http_info(id, opts) + def get_idpby_id(identity_provider_service_get_idpby_id_request, opts = {}) + data, _status_code, _headers = get_idpby_id_with_http_info(identity_provider_service_get_idpby_id_request, opts) data end - # Get identity provider (IdP) by ID - # Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. - # @param id [String] + # GetIDPByID + # Get identity provider (IdP) by ID Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. + # @param identity_provider_service_get_idpby_id_request [IdentityProviderServiceGetIDPByIDRequest] # @param [Hash] opts the optional parameters # @return [Array<(IdentityProviderServiceGetIDPByIDResponse, Integer, Hash)>] IdentityProviderServiceGetIDPByIDResponse data, response status code and response headers - def identity_provider_service_get_idpby_id_with_http_info(id, opts = {}) + def get_idpby_id_with_http_info(identity_provider_service_get_idpby_id_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::IdentityProviderServiceApi.identity_provider_service_get_idpby_id ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::IdentityProviderServiceApi.get_idpby_id ...' # MODIFIED 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 Api::IdentityProviderServiceApi.identity_provider_service_get_idpby_id" # MODIFIED + # verify the required parameter 'identity_provider_service_get_idpby_id_request' is set + if @api_client.config.client_side_validation && identity_provider_service_get_idpby_id_request.nil? + fail ArgumentError, "Missing the required parameter 'identity_provider_service_get_idpby_id_request' when calling Api::IdentityProviderServiceApi.get_idpby_id" # MODIFIED end # resource path - local_var_path = '/v2/idps/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/zitadel.idp.v2.IdentityProviderService/GetIDPByID' # query parameters query_params = opts[:query_params] || {} @@ -52,12 +52,17 @@ def identity_provider_service_get_idpby_id_with_http_info(id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_provider_service_get_idpby_id_request) # return_type return_type = opts[:debug_return_type] || 'IdentityProviderServiceGetIDPByIDResponse' @@ -66,7 +71,7 @@ def identity_provider_service_get_idpby_id_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::IdentityProviderServiceApi.identity_provider_service_get_idpby_id", # MODIFIED + :operation => :"Api::IdentityProviderServiceApi.get_idpby_id", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -75,9 +80,9 @@ def identity_provider_service_get_idpby_id_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::IdentityProviderServiceApi#identity_provider_service_get_idpby_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::IdentityProviderServiceApi#get_idpby_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end diff --git a/lib/zitadel/client/api/o_i_d_c_service_api.rb b/lib/zitadel/client/api/o_i_d_c_service_api.rb index 419e1e01..b225091f 100644 --- a/lib/zitadel/client/api/o_i_d_c_service_api.rb +++ b/lib/zitadel/client/api/o_i_d_c_service_api.rb @@ -19,37 +19,31 @@ class OIDCServiceApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Authorize or deny device authorization - # Authorize or deny the device authorization request based on the provided device authorization id. - # @param device_authorization_id [String] The device authorization id returned when submitting the user code. + # AuthorizeOrDenyDeviceAuthorization + # Authorize or deny device authorization Authorize or deny the device authorization request based on the provided device authorization id. # @param oidc_service_authorize_or_deny_device_authorization_request [OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest] # @param [Hash] opts the optional parameters # @return [Object] - def o_idc_service_authorize_or_deny_device_authorization(device_authorization_id, oidc_service_authorize_or_deny_device_authorization_request, opts = {}) - data, _status_code, _headers = o_idc_service_authorize_or_deny_device_authorization_with_http_info(device_authorization_id, oidc_service_authorize_or_deny_device_authorization_request, opts) + def authorize_or_deny_device_authorization(oidc_service_authorize_or_deny_device_authorization_request, opts = {}) + data, _status_code, _headers = authorize_or_deny_device_authorization_with_http_info(oidc_service_authorize_or_deny_device_authorization_request, opts) data end - # Authorize or deny device authorization - # Authorize or deny the device authorization request based on the provided device authorization id. - # @param device_authorization_id [String] The device authorization id returned when submitting the user code. + # AuthorizeOrDenyDeviceAuthorization + # Authorize or deny device authorization Authorize or deny the device authorization request based on the provided device authorization id. # @param oidc_service_authorize_or_deny_device_authorization_request [OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest] # @param [Hash] opts the optional parameters # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def o_idc_service_authorize_or_deny_device_authorization_with_http_info(device_authorization_id, oidc_service_authorize_or_deny_device_authorization_request, opts = {}) + def authorize_or_deny_device_authorization_with_http_info(oidc_service_authorize_or_deny_device_authorization_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.o_idc_service_authorize_or_deny_device_authorization ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.authorize_or_deny_device_authorization ...' # MODIFIED end - # verify the required parameter 'device_authorization_id' is set - if @api_client.config.client_side_validation && device_authorization_id.nil? - fail ArgumentError, "Missing the required parameter 'device_authorization_id' when calling Api::OIDCServiceApi.o_idc_service_authorize_or_deny_device_authorization" # MODIFIED - end # verify the required parameter 'oidc_service_authorize_or_deny_device_authorization_request' is set if @api_client.config.client_side_validation && oidc_service_authorize_or_deny_device_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'oidc_service_authorize_or_deny_device_authorization_request' when calling Api::OIDCServiceApi.o_idc_service_authorize_or_deny_device_authorization" # MODIFIED + fail ArgumentError, "Missing the required parameter 'oidc_service_authorize_or_deny_device_authorization_request' when calling Api::OIDCServiceApi.authorize_or_deny_device_authorization" # MODIFIED end # resource path - local_var_path = '/v2/oidc/device_authorization/{deviceAuthorizationId}'.sub('{' + 'deviceAuthorizationId' + '}', CGI.escape(device_authorization_id.to_s)) + local_var_path = '/zitadel.oidc.v2.OIDCService/AuthorizeOrDenyDeviceAuthorization' # query parameters query_params = opts[:query_params] || {} @@ -77,7 +71,7 @@ def o_idc_service_authorize_or_deny_device_authorization_with_http_info(device_a auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::OIDCServiceApi.o_idc_service_authorize_or_deny_device_authorization", # MODIFIED + :operation => :"Api::OIDCServiceApi.authorize_or_deny_device_authorization", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -88,42 +82,34 @@ def o_idc_service_authorize_or_deny_device_authorization_with_http_info(device_a 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: Api::OIDCServiceApi#o_idc_service_authorize_or_deny_device_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::OIDCServiceApi#authorize_or_deny_device_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Finalize an Auth Request and get the callback URL. - # Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. - # @param auth_request_id [String] ID of the Auth Request. + # CreateCallback # @param oidc_service_create_callback_request [OIDCServiceCreateCallbackRequest] # @param [Hash] opts the optional parameters # @return [OIDCServiceCreateCallbackResponse] - def o_idc_service_create_callback(auth_request_id, oidc_service_create_callback_request, opts = {}) - data, _status_code, _headers = o_idc_service_create_callback_with_http_info(auth_request_id, oidc_service_create_callback_request, opts) + def create_callback(oidc_service_create_callback_request, opts = {}) + data, _status_code, _headers = create_callback_with_http_info(oidc_service_create_callback_request, opts) data end - # Finalize an Auth Request and get the callback URL. - # Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. - # @param auth_request_id [String] ID of the Auth Request. + # CreateCallback # @param oidc_service_create_callback_request [OIDCServiceCreateCallbackRequest] # @param [Hash] opts the optional parameters # @return [Array<(OIDCServiceCreateCallbackResponse, Integer, Hash)>] OIDCServiceCreateCallbackResponse data, response status code and response headers - def o_idc_service_create_callback_with_http_info(auth_request_id, oidc_service_create_callback_request, opts = {}) + def create_callback_with_http_info(oidc_service_create_callback_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.o_idc_service_create_callback ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.create_callback ...' # MODIFIED end - # verify the required parameter 'auth_request_id' is set - if @api_client.config.client_side_validation && auth_request_id.nil? - fail ArgumentError, "Missing the required parameter 'auth_request_id' when calling Api::OIDCServiceApi.o_idc_service_create_callback" # MODIFIED - end # verify the required parameter 'oidc_service_create_callback_request' is set if @api_client.config.client_side_validation && oidc_service_create_callback_request.nil? - fail ArgumentError, "Missing the required parameter 'oidc_service_create_callback_request' when calling Api::OIDCServiceApi.o_idc_service_create_callback" # MODIFIED + fail ArgumentError, "Missing the required parameter 'oidc_service_create_callback_request' when calling Api::OIDCServiceApi.create_callback" # MODIFIED end # resource path - local_var_path = '/v2/oidc/auth_requests/{authRequestId}'.sub('{' + 'authRequestId' + '}', CGI.escape(auth_request_id.to_s)) + local_var_path = '/zitadel.oidc.v2.OIDCService/CreateCallback' # query parameters query_params = opts[:query_params] || {} @@ -151,7 +137,7 @@ def o_idc_service_create_callback_with_http_info(auth_request_id, oidc_service_c auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::OIDCServiceApi.o_idc_service_create_callback", # MODIFIED + :operation => :"Api::OIDCServiceApi.create_callback", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -162,36 +148,34 @@ def o_idc_service_create_callback_with_http_info(auth_request_id, oidc_service_c 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: Api::OIDCServiceApi#o_idc_service_create_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::OIDCServiceApi#create_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Get OIDC Auth Request details - # Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. - # @param auth_request_id [String] ID of the Auth Request, as obtained from the redirect URL. + # GetAuthRequest + # @param oidc_service_get_auth_request_request [OIDCServiceGetAuthRequestRequest] # @param [Hash] opts the optional parameters # @return [OIDCServiceGetAuthRequestResponse] - def o_idc_service_get_auth_request(auth_request_id, opts = {}) - data, _status_code, _headers = o_idc_service_get_auth_request_with_http_info(auth_request_id, opts) + def get_auth_request(oidc_service_get_auth_request_request, opts = {}) + data, _status_code, _headers = get_auth_request_with_http_info(oidc_service_get_auth_request_request, opts) data end - # Get OIDC Auth Request details - # Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. - # @param auth_request_id [String] ID of the Auth Request, as obtained from the redirect URL. + # GetAuthRequest + # @param oidc_service_get_auth_request_request [OIDCServiceGetAuthRequestRequest] # @param [Hash] opts the optional parameters # @return [Array<(OIDCServiceGetAuthRequestResponse, Integer, Hash)>] OIDCServiceGetAuthRequestResponse data, response status code and response headers - def o_idc_service_get_auth_request_with_http_info(auth_request_id, opts = {}) + def get_auth_request_with_http_info(oidc_service_get_auth_request_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.o_idc_service_get_auth_request ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.get_auth_request ...' # MODIFIED end - # verify the required parameter 'auth_request_id' is set - if @api_client.config.client_side_validation && auth_request_id.nil? - fail ArgumentError, "Missing the required parameter 'auth_request_id' when calling Api::OIDCServiceApi.o_idc_service_get_auth_request" # MODIFIED + # verify the required parameter 'oidc_service_get_auth_request_request' is set + if @api_client.config.client_side_validation && oidc_service_get_auth_request_request.nil? + fail ArgumentError, "Missing the required parameter 'oidc_service_get_auth_request_request' when calling Api::OIDCServiceApi.get_auth_request" # MODIFIED end # resource path - local_var_path = '/v2/oidc/auth_requests/{authRequestId}'.sub('{' + 'authRequestId' + '}', CGI.escape(auth_request_id.to_s)) + local_var_path = '/zitadel.oidc.v2.OIDCService/GetAuthRequest' # query parameters query_params = opts[:query_params] || {} @@ -200,12 +184,17 @@ def o_idc_service_get_auth_request_with_http_info(auth_request_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(oidc_service_get_auth_request_request) # return_type return_type = opts[:debug_return_type] || 'OIDCServiceGetAuthRequestResponse' @@ -214,7 +203,7 @@ def o_idc_service_get_auth_request_with_http_info(auth_request_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::OIDCServiceApi.o_idc_service_get_auth_request", # MODIFIED + :operation => :"Api::OIDCServiceApi.get_auth_request", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -223,38 +212,38 @@ def o_idc_service_get_auth_request_with_http_info(auth_request_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::OIDCServiceApi#o_idc_service_get_auth_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::OIDCServiceApi#get_auth_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Get device authorization request - # Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. - # @param user_code [String] The user_code returned by the device authorization request and provided to the user by the device. + # GetDeviceAuthorizationRequest + # Get device authorization request Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. + # @param oidc_service_get_device_authorization_request_request [OIDCServiceGetDeviceAuthorizationRequestRequest] # @param [Hash] opts the optional parameters # @return [OIDCServiceGetDeviceAuthorizationRequestResponse] - def o_idc_service_get_device_authorization_request(user_code, opts = {}) - data, _status_code, _headers = o_idc_service_get_device_authorization_request_with_http_info(user_code, opts) + def get_device_authorization_request(oidc_service_get_device_authorization_request_request, opts = {}) + data, _status_code, _headers = get_device_authorization_request_with_http_info(oidc_service_get_device_authorization_request_request, opts) data end - # Get device authorization request - # Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. - # @param user_code [String] The user_code returned by the device authorization request and provided to the user by the device. + # GetDeviceAuthorizationRequest + # Get device authorization request Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. + # @param oidc_service_get_device_authorization_request_request [OIDCServiceGetDeviceAuthorizationRequestRequest] # @param [Hash] opts the optional parameters # @return [Array<(OIDCServiceGetDeviceAuthorizationRequestResponse, Integer, Hash)>] OIDCServiceGetDeviceAuthorizationRequestResponse data, response status code and response headers - def o_idc_service_get_device_authorization_request_with_http_info(user_code, opts = {}) + def get_device_authorization_request_with_http_info(oidc_service_get_device_authorization_request_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.o_idc_service_get_device_authorization_request ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.get_device_authorization_request ...' # MODIFIED end - # verify the required parameter 'user_code' is set - if @api_client.config.client_side_validation && user_code.nil? - fail ArgumentError, "Missing the required parameter 'user_code' when calling Api::OIDCServiceApi.o_idc_service_get_device_authorization_request" # MODIFIED + # verify the required parameter 'oidc_service_get_device_authorization_request_request' is set + if @api_client.config.client_side_validation && oidc_service_get_device_authorization_request_request.nil? + fail ArgumentError, "Missing the required parameter 'oidc_service_get_device_authorization_request_request' when calling Api::OIDCServiceApi.get_device_authorization_request" # MODIFIED end # resource path - local_var_path = '/v2/oidc/device_authorization/{userCode}'.sub('{' + 'userCode' + '}', CGI.escape(user_code.to_s)) + local_var_path = '/zitadel.oidc.v2.OIDCService/GetDeviceAuthorizationRequest' # query parameters query_params = opts[:query_params] || {} @@ -263,12 +252,17 @@ def o_idc_service_get_device_authorization_request_with_http_info(user_code, opt 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(oidc_service_get_device_authorization_request_request) # return_type return_type = opts[:debug_return_type] || 'OIDCServiceGetDeviceAuthorizationRequestResponse' @@ -277,7 +271,7 @@ def o_idc_service_get_device_authorization_request_with_http_info(user_code, opt auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::OIDCServiceApi.o_idc_service_get_device_authorization_request", # MODIFIED + :operation => :"Api::OIDCServiceApi.get_device_authorization_request", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -286,9 +280,9 @@ def o_idc_service_get_device_authorization_request_with_http_info(user_code, opt :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::OIDCServiceApi#o_idc_service_get_device_authorization_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::OIDCServiceApi#get_device_authorization_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end diff --git a/lib/zitadel/client/api/organization_service_api.rb b/lib/zitadel/client/api/organization_service_api.rb index 4eac7354..20f18233 100644 --- a/lib/zitadel/client/api/organization_service_api.rb +++ b/lib/zitadel/client/api/organization_service_api.rb @@ -19,31 +19,31 @@ class OrganizationServiceApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create an Organization - # Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. + # AddOrganization + # Create an Organization Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. # @param organization_service_add_organization_request [OrganizationServiceAddOrganizationRequest] # @param [Hash] opts the optional parameters # @return [OrganizationServiceAddOrganizationResponse] - def organization_service_add_organization(organization_service_add_organization_request, opts = {}) - data, _status_code, _headers = organization_service_add_organization_with_http_info(organization_service_add_organization_request, opts) + def add_organization(organization_service_add_organization_request, opts = {}) + data, _status_code, _headers = add_organization_with_http_info(organization_service_add_organization_request, opts) data end - # Create an Organization - # Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. + # AddOrganization + # Create an Organization Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. # @param organization_service_add_organization_request [OrganizationServiceAddOrganizationRequest] # @param [Hash] opts the optional parameters # @return [Array<(OrganizationServiceAddOrganizationResponse, Integer, Hash)>] OrganizationServiceAddOrganizationResponse data, response status code and response headers - def organization_service_add_organization_with_http_info(organization_service_add_organization_request, opts = {}) + def add_organization_with_http_info(organization_service_add_organization_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.organization_service_add_organization ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.add_organization ...' # MODIFIED end # verify the required parameter 'organization_service_add_organization_request' is set if @api_client.config.client_side_validation && organization_service_add_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_add_organization_request' when calling Api::OrganizationServiceApi.organization_service_add_organization" # MODIFIED + fail ArgumentError, "Missing the required parameter 'organization_service_add_organization_request' when calling Api::OrganizationServiceApi.add_organization" # MODIFIED end # resource path - local_var_path = '/v2/organizations' + local_var_path = '/zitadel.org.v2.OrganizationService/AddOrganization' # query parameters query_params = opts[:query_params] || {} @@ -71,7 +71,7 @@ def organization_service_add_organization_with_http_info(organization_service_ad auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.organization_service_add_organization", # MODIFIED + :operation => :"Api::OrganizationServiceApi.add_organization", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -82,36 +82,36 @@ def organization_service_add_organization_with_http_info(organization_service_ad 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: Api::OrganizationServiceApi#organization_service_add_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#add_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Search Organizations - # Search for Organizations. By default, we will return all organization of the instance. Make sure to include a limit and sorting for pagination.. + # ListOrganizations + # Search Organizations Search for Organizations. By default, we will return all organization of the instance. Make sure to include a limit and sorting for pagination.. # @param organization_service_list_organizations_request [OrganizationServiceListOrganizationsRequest] # @param [Hash] opts the optional parameters # @return [OrganizationServiceListOrganizationsResponse] - def organization_service_list_organizations(organization_service_list_organizations_request, opts = {}) - data, _status_code, _headers = organization_service_list_organizations_with_http_info(organization_service_list_organizations_request, opts) + def list_organizations(organization_service_list_organizations_request, opts = {}) + data, _status_code, _headers = list_organizations_with_http_info(organization_service_list_organizations_request, opts) data end - # Search Organizations - # Search for Organizations. By default, we will return all organization of the instance. Make sure to include a limit and sorting for pagination.. + # ListOrganizations + # Search Organizations Search for Organizations. By default, we will return all organization of the instance. Make sure to include a limit and sorting for pagination.. # @param organization_service_list_organizations_request [OrganizationServiceListOrganizationsRequest] # @param [Hash] opts the optional parameters # @return [Array<(OrganizationServiceListOrganizationsResponse, Integer, Hash)>] OrganizationServiceListOrganizationsResponse data, response status code and response headers - def organization_service_list_organizations_with_http_info(organization_service_list_organizations_request, opts = {}) + def list_organizations_with_http_info(organization_service_list_organizations_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.organization_service_list_organizations ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.list_organizations ...' # MODIFIED end # verify the required parameter 'organization_service_list_organizations_request' is set if @api_client.config.client_side_validation && organization_service_list_organizations_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_list_organizations_request' when calling Api::OrganizationServiceApi.organization_service_list_organizations" # MODIFIED + fail ArgumentError, "Missing the required parameter 'organization_service_list_organizations_request' when calling Api::OrganizationServiceApi.list_organizations" # MODIFIED end # resource path - local_var_path = '/v2/organizations/_search' + local_var_path = '/zitadel.org.v2.OrganizationService/ListOrganizations' # query parameters query_params = opts[:query_params] || {} @@ -139,7 +139,7 @@ def organization_service_list_organizations_with_http_info(organization_service_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.organization_service_list_organizations", # MODIFIED + :operation => :"Api::OrganizationServiceApi.list_organizations", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -150,7 +150,7 @@ def organization_service_list_organizations_with_http_info(organization_service_ 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: Api::OrganizationServiceApi#organization_service_list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end diff --git a/lib/zitadel/client/api/s_a_m_l_service_api.rb b/lib/zitadel/client/api/s_a_m_l_service_api.rb index 2b745b9e..057b18ef 100644 --- a/lib/zitadel/client/api/s_a_m_l_service_api.rb +++ b/lib/zitadel/client/api/s_a_m_l_service_api.rb @@ -19,37 +19,29 @@ class SAMLServiceApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Finalize a SAML Request and get the response. - # Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. - # @param saml_request_id [String] ID of the SAML Request. + # CreateResponse # @param saml_service_create_response_request [SAMLServiceCreateResponseRequest] # @param [Hash] opts the optional parameters # @return [SAMLServiceCreateResponseResponse] - def s_aml_service_create_response(saml_request_id, saml_service_create_response_request, opts = {}) - data, _status_code, _headers = s_aml_service_create_response_with_http_info(saml_request_id, saml_service_create_response_request, opts) + def create_response(saml_service_create_response_request, opts = {}) + data, _status_code, _headers = create_response_with_http_info(saml_service_create_response_request, opts) data end - # Finalize a SAML Request and get the response. - # Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. - # @param saml_request_id [String] ID of the SAML Request. + # CreateResponse # @param saml_service_create_response_request [SAMLServiceCreateResponseRequest] # @param [Hash] opts the optional parameters # @return [Array<(SAMLServiceCreateResponseResponse, Integer, Hash)>] SAMLServiceCreateResponseResponse data, response status code and response headers - def s_aml_service_create_response_with_http_info(saml_request_id, saml_service_create_response_request, opts = {}) + def create_response_with_http_info(saml_service_create_response_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SAMLServiceApi.s_aml_service_create_response ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SAMLServiceApi.create_response ...' # MODIFIED end - # verify the required parameter 'saml_request_id' is set - if @api_client.config.client_side_validation && saml_request_id.nil? - fail ArgumentError, "Missing the required parameter 'saml_request_id' when calling Api::SAMLServiceApi.s_aml_service_create_response" # MODIFIED - end # verify the required parameter 'saml_service_create_response_request' is set if @api_client.config.client_side_validation && saml_service_create_response_request.nil? - fail ArgumentError, "Missing the required parameter 'saml_service_create_response_request' when calling Api::SAMLServiceApi.s_aml_service_create_response" # MODIFIED + fail ArgumentError, "Missing the required parameter 'saml_service_create_response_request' when calling Api::SAMLServiceApi.create_response" # MODIFIED end # resource path - local_var_path = '/v2/saml/saml_requests/{samlRequestId}'.sub('{' + 'samlRequestId' + '}', CGI.escape(saml_request_id.to_s)) + local_var_path = '/zitadel.saml.v2.SAMLService/CreateResponse' # query parameters query_params = opts[:query_params] || {} @@ -77,7 +69,7 @@ def s_aml_service_create_response_with_http_info(saml_request_id, saml_service_c auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SAMLServiceApi.s_aml_service_create_response", # MODIFIED + :operation => :"Api::SAMLServiceApi.create_response", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -88,36 +80,34 @@ def s_aml_service_create_response_with_http_info(saml_request_id, saml_service_c 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: Api::SAMLServiceApi#s_aml_service_create_response\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SAMLServiceApi#create_response\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Get SAML Request details - # Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. - # @param saml_request_id [String] ID of the SAML Request, as obtained from the redirect URL. + # GetSAMLRequest + # @param saml_service_get_saml_request_request [SAMLServiceGetSAMLRequestRequest] # @param [Hash] opts the optional parameters # @return [SAMLServiceGetSAMLRequestResponse] - def s_aml_service_get_saml_request(saml_request_id, opts = {}) - data, _status_code, _headers = s_aml_service_get_saml_request_with_http_info(saml_request_id, opts) + def get_saml_request(saml_service_get_saml_request_request, opts = {}) + data, _status_code, _headers = get_saml_request_with_http_info(saml_service_get_saml_request_request, opts) data end - # Get SAML Request details - # Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. - # @param saml_request_id [String] ID of the SAML Request, as obtained from the redirect URL. + # GetSAMLRequest + # @param saml_service_get_saml_request_request [SAMLServiceGetSAMLRequestRequest] # @param [Hash] opts the optional parameters # @return [Array<(SAMLServiceGetSAMLRequestResponse, Integer, Hash)>] SAMLServiceGetSAMLRequestResponse data, response status code and response headers - def s_aml_service_get_saml_request_with_http_info(saml_request_id, opts = {}) + def get_saml_request_with_http_info(saml_service_get_saml_request_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SAMLServiceApi.s_aml_service_get_saml_request ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SAMLServiceApi.get_saml_request ...' # MODIFIED end - # verify the required parameter 'saml_request_id' is set - if @api_client.config.client_side_validation && saml_request_id.nil? - fail ArgumentError, "Missing the required parameter 'saml_request_id' when calling Api::SAMLServiceApi.s_aml_service_get_saml_request" # MODIFIED + # verify the required parameter 'saml_service_get_saml_request_request' is set + if @api_client.config.client_side_validation && saml_service_get_saml_request_request.nil? + fail ArgumentError, "Missing the required parameter 'saml_service_get_saml_request_request' when calling Api::SAMLServiceApi.get_saml_request" # MODIFIED end # resource path - local_var_path = '/v2/saml/saml_requests/{samlRequestId}'.sub('{' + 'samlRequestId' + '}', CGI.escape(saml_request_id.to_s)) + local_var_path = '/zitadel.saml.v2.SAMLService/GetSAMLRequest' # query parameters query_params = opts[:query_params] || {} @@ -126,12 +116,17 @@ def s_aml_service_get_saml_request_with_http_info(saml_request_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(saml_service_get_saml_request_request) # return_type return_type = opts[:debug_return_type] || 'SAMLServiceGetSAMLRequestResponse' @@ -140,7 +135,7 @@ def s_aml_service_get_saml_request_with_http_info(saml_request_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SAMLServiceApi.s_aml_service_get_saml_request", # MODIFIED + :operation => :"Api::SAMLServiceApi.get_saml_request", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -149,9 +144,9 @@ def s_aml_service_get_saml_request_with_http_info(saml_request_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SAMLServiceApi#s_aml_service_get_saml_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SAMLServiceApi#get_saml_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end diff --git a/lib/zitadel/client/api/session_service_api.rb b/lib/zitadel/client/api/session_service_api.rb index 0e285a41..a206139b 100644 --- a/lib/zitadel/client/api/session_service_api.rb +++ b/lib/zitadel/client/api/session_service_api.rb @@ -19,31 +19,31 @@ class SessionServiceApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # CreateSession # Create a new session - # Create a new session. A token will be returned, which is required for further updates of the session. # @param session_service_create_session_request [SessionServiceCreateSessionRequest] # @param [Hash] opts the optional parameters # @return [SessionServiceCreateSessionResponse] - def session_service_create_session(session_service_create_session_request, opts = {}) - data, _status_code, _headers = session_service_create_session_with_http_info(session_service_create_session_request, opts) + def create_session(session_service_create_session_request, opts = {}) + data, _status_code, _headers = create_session_with_http_info(session_service_create_session_request, opts) data end + # CreateSession # Create a new session - # Create a new session. A token will be returned, which is required for further updates of the session. # @param session_service_create_session_request [SessionServiceCreateSessionRequest] # @param [Hash] opts the optional parameters # @return [Array<(SessionServiceCreateSessionResponse, Integer, Hash)>] SessionServiceCreateSessionResponse data, response status code and response headers - def session_service_create_session_with_http_info(session_service_create_session_request, opts = {}) + def create_session_with_http_info(session_service_create_session_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.session_service_create_session ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.create_session ...' # MODIFIED end # verify the required parameter 'session_service_create_session_request' is set if @api_client.config.client_side_validation && session_service_create_session_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_create_session_request' when calling Api::SessionServiceApi.session_service_create_session" # MODIFIED + fail ArgumentError, "Missing the required parameter 'session_service_create_session_request' when calling Api::SessionServiceApi.create_session" # MODIFIED end # resource path - local_var_path = '/v2/sessions' + local_var_path = '/zitadel.session.v2.SessionService/CreateSession' # query parameters query_params = opts[:query_params] || {} @@ -71,7 +71,7 @@ def session_service_create_session_with_http_info(session_service_create_session auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SessionServiceApi.session_service_create_session", # MODIFIED + :operation => :"Api::SessionServiceApi.create_session", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -82,42 +82,36 @@ def session_service_create_session_with_http_info(session_service_create_session 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: Api::SessionServiceApi#session_service_create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SessionServiceApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Terminate an existing session - # Terminate your own session or if granted any other session. - # @param session_id [String] \"id of the session to terminate\" + # DeleteSession + # Terminate a session # @param session_service_delete_session_request [SessionServiceDeleteSessionRequest] # @param [Hash] opts the optional parameters # @return [SessionServiceDeleteSessionResponse] - def session_service_delete_session(session_id, session_service_delete_session_request, opts = {}) - data, _status_code, _headers = session_service_delete_session_with_http_info(session_id, session_service_delete_session_request, opts) + def delete_session(session_service_delete_session_request, opts = {}) + data, _status_code, _headers = delete_session_with_http_info(session_service_delete_session_request, opts) data end - # Terminate an existing session - # Terminate your own session or if granted any other session. - # @param session_id [String] \"id of the session to terminate\" + # DeleteSession + # Terminate a session # @param session_service_delete_session_request [SessionServiceDeleteSessionRequest] # @param [Hash] opts the optional parameters # @return [Array<(SessionServiceDeleteSessionResponse, Integer, Hash)>] SessionServiceDeleteSessionResponse data, response status code and response headers - def session_service_delete_session_with_http_info(session_id, session_service_delete_session_request, opts = {}) + def delete_session_with_http_info(session_service_delete_session_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.session_service_delete_session ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.delete_session ...' # MODIFIED end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling Api::SessionServiceApi.session_service_delete_session" # MODIFIED - end # verify the required parameter 'session_service_delete_session_request' is set if @api_client.config.client_side_validation && session_service_delete_session_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_delete_session_request' when calling Api::SessionServiceApi.session_service_delete_session" # MODIFIED + fail ArgumentError, "Missing the required parameter 'session_service_delete_session_request' when calling Api::SessionServiceApi.delete_session" # MODIFIED end # resource path - local_var_path = '/v2/sessions/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) + local_var_path = '/zitadel.session.v2.SessionService/DeleteSession' # query parameters query_params = opts[:query_params] || {} @@ -145,7 +139,7 @@ def session_service_delete_session_with_http_info(session_id, session_service_de auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SessionServiceApi.session_service_delete_session", # MODIFIED + :operation => :"Api::SessionServiceApi.delete_session", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -154,55 +148,57 @@ def session_service_delete_session_with_http_info(session_id, session_service_de :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::SessionServiceApi#session_service_delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SessionServiceApi#delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Get a session - # Get a session and all its information like the time of the user or password verification - # @param session_id [String] + # GetSession + # GetSession a session + # @param session_service_get_session_request [SessionServiceGetSessionRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :session_token # @return [SessionServiceGetSessionResponse] - def session_service_get_session(session_id, opts = {}) - data, _status_code, _headers = session_service_get_session_with_http_info(session_id, opts) + def get_session(session_service_get_session_request, opts = {}) + data, _status_code, _headers = get_session_with_http_info(session_service_get_session_request, opts) data end - # Get a session - # Get a session and all its information like the time of the user or password verification - # @param session_id [String] + # GetSession + # GetSession a session + # @param session_service_get_session_request [SessionServiceGetSessionRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :session_token # @return [Array<(SessionServiceGetSessionResponse, Integer, Hash)>] SessionServiceGetSessionResponse data, response status code and response headers - def session_service_get_session_with_http_info(session_id, opts = {}) + def get_session_with_http_info(session_service_get_session_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.session_service_get_session ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.get_session ...' # MODIFIED end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling Api::SessionServiceApi.session_service_get_session" # MODIFIED + # verify the required parameter 'session_service_get_session_request' is set + if @api_client.config.client_side_validation && session_service_get_session_request.nil? + fail ArgumentError, "Missing the required parameter 'session_service_get_session_request' when calling Api::SessionServiceApi.get_session" # MODIFIED end # resource path - local_var_path = '/v2/sessions/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) + local_var_path = '/zitadel.session.v2.SessionService/GetSession' # query parameters query_params = opts[:query_params] || {} - query_params[:'sessionToken'] = opts[:'session_token'] if !opts[:'session_token'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(session_service_get_session_request) # return_type return_type = opts[:debug_return_type] || 'SessionServiceGetSessionResponse' @@ -211,7 +207,7 @@ def session_service_get_session_with_http_info(session_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SessionServiceApi.session_service_get_session", # MODIFIED + :operation => :"Api::SessionServiceApi.get_session", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -220,38 +216,38 @@ def session_service_get_session_with_http_info(session_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SessionServiceApi#session_service_get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SessionServiceApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # ListSessions # Search sessions - # Search for sessions # @param session_service_list_sessions_request [SessionServiceListSessionsRequest] # @param [Hash] opts the optional parameters # @return [SessionServiceListSessionsResponse] - def session_service_list_sessions(session_service_list_sessions_request, opts = {}) - data, _status_code, _headers = session_service_list_sessions_with_http_info(session_service_list_sessions_request, opts) + def list_sessions(session_service_list_sessions_request, opts = {}) + data, _status_code, _headers = list_sessions_with_http_info(session_service_list_sessions_request, opts) data end + # ListSessions # Search sessions - # Search for sessions # @param session_service_list_sessions_request [SessionServiceListSessionsRequest] # @param [Hash] opts the optional parameters # @return [Array<(SessionServiceListSessionsResponse, Integer, Hash)>] SessionServiceListSessionsResponse data, response status code and response headers - def session_service_list_sessions_with_http_info(session_service_list_sessions_request, opts = {}) + def list_sessions_with_http_info(session_service_list_sessions_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.session_service_list_sessions ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.list_sessions ...' # MODIFIED end # verify the required parameter 'session_service_list_sessions_request' is set if @api_client.config.client_side_validation && session_service_list_sessions_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_list_sessions_request' when calling Api::SessionServiceApi.session_service_list_sessions" # MODIFIED + fail ArgumentError, "Missing the required parameter 'session_service_list_sessions_request' when calling Api::SessionServiceApi.list_sessions" # MODIFIED end # resource path - local_var_path = '/v2/sessions/search' + local_var_path = '/zitadel.session.v2.SessionService/ListSessions' # query parameters query_params = opts[:query_params] || {} @@ -279,7 +275,7 @@ def session_service_list_sessions_with_http_info(session_service_list_sessions_r auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SessionServiceApi.session_service_list_sessions", # MODIFIED + :operation => :"Api::SessionServiceApi.list_sessions", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -290,42 +286,36 @@ def session_service_list_sessions_with_http_info(session_service_list_sessions_r 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: Api::SessionServiceApi#session_service_list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SessionServiceApi#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Update an existing session - # Update an existing session with new information. - # @param session_id [String] \"id of the session to update\" + # SetSession + # Update a session # @param session_service_set_session_request [SessionServiceSetSessionRequest] # @param [Hash] opts the optional parameters # @return [SessionServiceSetSessionResponse] - def session_service_set_session(session_id, session_service_set_session_request, opts = {}) - data, _status_code, _headers = session_service_set_session_with_http_info(session_id, session_service_set_session_request, opts) + def set_session(session_service_set_session_request, opts = {}) + data, _status_code, _headers = set_session_with_http_info(session_service_set_session_request, opts) data end - # Update an existing session - # Update an existing session with new information. - # @param session_id [String] \"id of the session to update\" + # SetSession + # Update a session # @param session_service_set_session_request [SessionServiceSetSessionRequest] # @param [Hash] opts the optional parameters # @return [Array<(SessionServiceSetSessionResponse, Integer, Hash)>] SessionServiceSetSessionResponse data, response status code and response headers - def session_service_set_session_with_http_info(session_id, session_service_set_session_request, opts = {}) + def set_session_with_http_info(session_service_set_session_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.session_service_set_session ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.set_session ...' # MODIFIED end - # verify the required parameter 'session_id' is set - if @api_client.config.client_side_validation && session_id.nil? - fail ArgumentError, "Missing the required parameter 'session_id' when calling Api::SessionServiceApi.session_service_set_session" # MODIFIED - end # verify the required parameter 'session_service_set_session_request' is set if @api_client.config.client_side_validation && session_service_set_session_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_set_session_request' when calling Api::SessionServiceApi.session_service_set_session" # MODIFIED + fail ArgumentError, "Missing the required parameter 'session_service_set_session_request' when calling Api::SessionServiceApi.set_session" # MODIFIED end # resource path - local_var_path = '/v2/sessions/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) + local_var_path = '/zitadel.session.v2.SessionService/SetSession' # query parameters query_params = opts[:query_params] || {} @@ -353,7 +343,7 @@ def session_service_set_session_with_http_info(session_id, session_service_set_s auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SessionServiceApi.session_service_set_session", # MODIFIED + :operation => :"Api::SessionServiceApi.set_session", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -362,9 +352,9 @@ def session_service_set_session_with_http_info(session_id, session_service_set_s :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + 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: Api::SessionServiceApi#session_service_set_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SessionServiceApi#set_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end diff --git a/lib/zitadel/client/api/settings_service_api.rb b/lib/zitadel/client/api/settings_service_api.rb index 4cc7b6c1..448da833 100644 --- a/lib/zitadel/client/api/settings_service_api.rb +++ b/lib/zitadel/client/api/settings_service_api.rb @@ -19,57 +19,50 @@ class SettingsServiceApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # GetActiveIdentityProviders # Get the current active identity providers - # Return the current active identity providers for the requested context + # @param settings_service_get_active_identity_providers_request [SettingsServiceGetActiveIdentityProvidersRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance - # @option opts [Boolean] :creation_allowed - # @option opts [Boolean] :linking_allowed - # @option opts [Boolean] :auto_creation - # @option opts [Boolean] :auto_linking # @return [SettingsServiceGetActiveIdentityProvidersResponse] - def settings_service_get_active_identity_providers(opts = {}) - data, _status_code, _headers = settings_service_get_active_identity_providers_with_http_info(opts) + def get_active_identity_providers(settings_service_get_active_identity_providers_request, opts = {}) + data, _status_code, _headers = get_active_identity_providers_with_http_info(settings_service_get_active_identity_providers_request, opts) data end + # GetActiveIdentityProviders # Get the current active identity providers - # Return the current active identity providers for the requested context + # @param settings_service_get_active_identity_providers_request [SettingsServiceGetActiveIdentityProvidersRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance - # @option opts [Boolean] :creation_allowed - # @option opts [Boolean] :linking_allowed - # @option opts [Boolean] :auto_creation - # @option opts [Boolean] :auto_linking # @return [Array<(SettingsServiceGetActiveIdentityProvidersResponse, Integer, Hash)>] SettingsServiceGetActiveIdentityProvidersResponse data, response status code and response headers - def settings_service_get_active_identity_providers_with_http_info(opts = {}) + def get_active_identity_providers_with_http_info(settings_service_get_active_identity_providers_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_active_identity_providers ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_active_identity_providers ...' # MODIFIED end + # verify the required parameter 'settings_service_get_active_identity_providers_request' is set + if @api_client.config.client_side_validation && settings_service_get_active_identity_providers_request.nil? + fail ArgumentError, "Missing the required parameter 'settings_service_get_active_identity_providers_request' when calling Api::SettingsServiceApi.get_active_identity_providers" # MODIFIED + end # resource path - local_var_path = '/v2/settings/login/idps' + local_var_path = '/zitadel.settings.v2.SettingsService/GetActiveIdentityProviders' # query parameters query_params = opts[:query_params] || {} - query_params[:'ctx.orgId'] = opts[:'ctx_org_id'] if !opts[:'ctx_org_id'].nil? - query_params[:'ctx.instance'] = opts[:'ctx_instance'] if !opts[:'ctx_instance'].nil? - query_params[:'creationAllowed'] = opts[:'creation_allowed'] if !opts[:'creation_allowed'].nil? - query_params[:'linkingAllowed'] = opts[:'linking_allowed'] if !opts[:'linking_allowed'].nil? - query_params[:'autoCreation'] = opts[:'auto_creation'] if !opts[:'auto_creation'].nil? - query_params[:'autoLinking'] = opts[:'auto_linking'] if !opts[:'auto_linking'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_active_identity_providers_request) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetActiveIdentityProvidersResponse' @@ -78,7 +71,7 @@ def settings_service_get_active_identity_providers_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_active_identity_providers", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_active_identity_providers", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -87,52 +80,57 @@ def settings_service_get_active_identity_providers_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_active_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_active_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # GetBrandingSettings # Get the current active branding settings - # Return the current active branding settings for the requested context + # @param settings_service_get_branding_settings_request [SettingsServiceGetBrandingSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [SettingsServiceGetBrandingSettingsResponse] - def settings_service_get_branding_settings(opts = {}) - data, _status_code, _headers = settings_service_get_branding_settings_with_http_info(opts) + def get_branding_settings(settings_service_get_branding_settings_request, opts = {}) + data, _status_code, _headers = get_branding_settings_with_http_info(settings_service_get_branding_settings_request, opts) data end + # GetBrandingSettings # Get the current active branding settings - # Return the current active branding settings for the requested context + # @param settings_service_get_branding_settings_request [SettingsServiceGetBrandingSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [Array<(SettingsServiceGetBrandingSettingsResponse, Integer, Hash)>] SettingsServiceGetBrandingSettingsResponse data, response status code and response headers - def settings_service_get_branding_settings_with_http_info(opts = {}) + def get_branding_settings_with_http_info(settings_service_get_branding_settings_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_branding_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_branding_settings ...' # MODIFIED end + # verify the required parameter 'settings_service_get_branding_settings_request' is set + if @api_client.config.client_side_validation && settings_service_get_branding_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'settings_service_get_branding_settings_request' when calling Api::SettingsServiceApi.get_branding_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings/branding' + local_var_path = '/zitadel.settings.v2.SettingsService/GetBrandingSettings' # query parameters query_params = opts[:query_params] || {} - query_params[:'ctx.orgId'] = opts[:'ctx_org_id'] if !opts[:'ctx_org_id'].nil? - query_params[:'ctx.instance'] = opts[:'ctx_instance'] if !opts[:'ctx_instance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_branding_settings_request) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetBrandingSettingsResponse' @@ -141,7 +139,7 @@ def settings_service_get_branding_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_branding_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_branding_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -150,52 +148,57 @@ def settings_service_get_branding_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_branding_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_branding_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # GetDomainSettings # Get the domain settings - # Return the domain settings for the requested context + # @param settings_service_get_domain_settings_request [SettingsServiceGetDomainSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [SettingsServiceGetDomainSettingsResponse] - def settings_service_get_domain_settings(opts = {}) - data, _status_code, _headers = settings_service_get_domain_settings_with_http_info(opts) + def get_domain_settings(settings_service_get_domain_settings_request, opts = {}) + data, _status_code, _headers = get_domain_settings_with_http_info(settings_service_get_domain_settings_request, opts) data end + # GetDomainSettings # Get the domain settings - # Return the domain settings for the requested context + # @param settings_service_get_domain_settings_request [SettingsServiceGetDomainSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [Array<(SettingsServiceGetDomainSettingsResponse, Integer, Hash)>] SettingsServiceGetDomainSettingsResponse data, response status code and response headers - def settings_service_get_domain_settings_with_http_info(opts = {}) + def get_domain_settings_with_http_info(settings_service_get_domain_settings_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_domain_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_domain_settings ...' # MODIFIED end + # verify the required parameter 'settings_service_get_domain_settings_request' is set + if @api_client.config.client_side_validation && settings_service_get_domain_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'settings_service_get_domain_settings_request' when calling Api::SettingsServiceApi.get_domain_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings/domain' + local_var_path = '/zitadel.settings.v2.SettingsService/GetDomainSettings' # query parameters query_params = opts[:query_params] || {} - query_params[:'ctx.orgId'] = opts[:'ctx_org_id'] if !opts[:'ctx_org_id'].nil? - query_params[:'ctx.instance'] = opts[:'ctx_instance'] if !opts[:'ctx_instance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_domain_settings_request) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetDomainSettingsResponse' @@ -204,7 +207,7 @@ def settings_service_get_domain_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_domain_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_domain_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -213,32 +216,38 @@ def settings_service_get_domain_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_domain_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_domain_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # GetGeneralSettings # Get basic information over the instance - # Return the basic information of the instance for the requested context + # @param body [Object] # @param [Hash] opts the optional parameters # @return [SettingsServiceGetGeneralSettingsResponse] - def settings_service_get_general_settings(opts = {}) - data, _status_code, _headers = settings_service_get_general_settings_with_http_info(opts) + def get_general_settings(body, opts = {}) + data, _status_code, _headers = get_general_settings_with_http_info(body, opts) data end + # GetGeneralSettings # Get basic information over the instance - # Return the basic information of the instance for the requested context + # @param body [Object] # @param [Hash] opts the optional parameters # @return [Array<(SettingsServiceGetGeneralSettingsResponse, Integer, Hash)>] SettingsServiceGetGeneralSettingsResponse data, response status code and response headers - def settings_service_get_general_settings_with_http_info(opts = {}) + def get_general_settings_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_general_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_general_settings ...' # MODIFIED end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::SettingsServiceApi.get_general_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings' + local_var_path = '/zitadel.settings.v2.SettingsService/GetGeneralSettings' # query parameters query_params = opts[:query_params] || {} @@ -247,12 +256,17 @@ def settings_service_get_general_settings_with_http_info(opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetGeneralSettingsResponse' @@ -261,7 +275,7 @@ def settings_service_get_general_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_general_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_general_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -270,52 +284,57 @@ def settings_service_get_general_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_general_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_general_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # GetLegalAndSupportSettings # Get the legal and support settings - # Return the legal settings for the requested context + # @param settings_service_get_legal_and_support_settings_request [SettingsServiceGetLegalAndSupportSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [SettingsServiceGetLegalAndSupportSettingsResponse] - def settings_service_get_legal_and_support_settings(opts = {}) - data, _status_code, _headers = settings_service_get_legal_and_support_settings_with_http_info(opts) + def get_legal_and_support_settings(settings_service_get_legal_and_support_settings_request, opts = {}) + data, _status_code, _headers = get_legal_and_support_settings_with_http_info(settings_service_get_legal_and_support_settings_request, opts) data end + # GetLegalAndSupportSettings # Get the legal and support settings - # Return the legal settings for the requested context + # @param settings_service_get_legal_and_support_settings_request [SettingsServiceGetLegalAndSupportSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [Array<(SettingsServiceGetLegalAndSupportSettingsResponse, Integer, Hash)>] SettingsServiceGetLegalAndSupportSettingsResponse data, response status code and response headers - def settings_service_get_legal_and_support_settings_with_http_info(opts = {}) + def get_legal_and_support_settings_with_http_info(settings_service_get_legal_and_support_settings_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_legal_and_support_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_legal_and_support_settings ...' # MODIFIED end + # verify the required parameter 'settings_service_get_legal_and_support_settings_request' is set + if @api_client.config.client_side_validation && settings_service_get_legal_and_support_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'settings_service_get_legal_and_support_settings_request' when calling Api::SettingsServiceApi.get_legal_and_support_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings/legal_support' + local_var_path = '/zitadel.settings.v2.SettingsService/GetLegalAndSupportSettings' # query parameters query_params = opts[:query_params] || {} - query_params[:'ctx.orgId'] = opts[:'ctx_org_id'] if !opts[:'ctx_org_id'].nil? - query_params[:'ctx.instance'] = opts[:'ctx_instance'] if !opts[:'ctx_instance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_legal_and_support_settings_request) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetLegalAndSupportSettingsResponse' @@ -324,7 +343,7 @@ def settings_service_get_legal_and_support_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_legal_and_support_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_legal_and_support_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -333,52 +352,57 @@ def settings_service_get_legal_and_support_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_legal_and_support_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_legal_and_support_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # GetLockoutSettings # Get the lockout settings - # Return the lockout settings for the requested context, which define when a user will be locked + # @param settings_service_get_lockout_settings_request [SettingsServiceGetLockoutSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [SettingsServiceGetLockoutSettingsResponse] - def settings_service_get_lockout_settings(opts = {}) - data, _status_code, _headers = settings_service_get_lockout_settings_with_http_info(opts) + def get_lockout_settings(settings_service_get_lockout_settings_request, opts = {}) + data, _status_code, _headers = get_lockout_settings_with_http_info(settings_service_get_lockout_settings_request, opts) data end + # GetLockoutSettings # Get the lockout settings - # Return the lockout settings for the requested context, which define when a user will be locked + # @param settings_service_get_lockout_settings_request [SettingsServiceGetLockoutSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [Array<(SettingsServiceGetLockoutSettingsResponse, Integer, Hash)>] SettingsServiceGetLockoutSettingsResponse data, response status code and response headers - def settings_service_get_lockout_settings_with_http_info(opts = {}) + def get_lockout_settings_with_http_info(settings_service_get_lockout_settings_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_lockout_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_lockout_settings ...' # MODIFIED end + # verify the required parameter 'settings_service_get_lockout_settings_request' is set + if @api_client.config.client_side_validation && settings_service_get_lockout_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'settings_service_get_lockout_settings_request' when calling Api::SettingsServiceApi.get_lockout_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings/lockout' + local_var_path = '/zitadel.settings.v2.SettingsService/GetLockoutSettings' # query parameters query_params = opts[:query_params] || {} - query_params[:'ctx.orgId'] = opts[:'ctx_org_id'] if !opts[:'ctx_org_id'].nil? - query_params[:'ctx.instance'] = opts[:'ctx_instance'] if !opts[:'ctx_instance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_lockout_settings_request) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetLockoutSettingsResponse' @@ -387,7 +411,7 @@ def settings_service_get_lockout_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_lockout_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_lockout_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -396,52 +420,57 @@ def settings_service_get_lockout_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_lockout_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_lockout_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # GetLoginSettings # Get the login settings - # Return the settings for the requested context + # @param settings_service_get_login_settings_request [SettingsServiceGetLoginSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [SettingsServiceGetLoginSettingsResponse] - def settings_service_get_login_settings(opts = {}) - data, _status_code, _headers = settings_service_get_login_settings_with_http_info(opts) + def get_login_settings(settings_service_get_login_settings_request, opts = {}) + data, _status_code, _headers = get_login_settings_with_http_info(settings_service_get_login_settings_request, opts) data end + # GetLoginSettings # Get the login settings - # Return the settings for the requested context + # @param settings_service_get_login_settings_request [SettingsServiceGetLoginSettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [Array<(SettingsServiceGetLoginSettingsResponse, Integer, Hash)>] SettingsServiceGetLoginSettingsResponse data, response status code and response headers - def settings_service_get_login_settings_with_http_info(opts = {}) + def get_login_settings_with_http_info(settings_service_get_login_settings_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_login_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_login_settings ...' # MODIFIED end + # verify the required parameter 'settings_service_get_login_settings_request' is set + if @api_client.config.client_side_validation && settings_service_get_login_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'settings_service_get_login_settings_request' when calling Api::SettingsServiceApi.get_login_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings/login' + local_var_path = '/zitadel.settings.v2.SettingsService/GetLoginSettings' # query parameters query_params = opts[:query_params] || {} - query_params[:'ctx.orgId'] = opts[:'ctx_org_id'] if !opts[:'ctx_org_id'].nil? - query_params[:'ctx.instance'] = opts[:'ctx_instance'] if !opts[:'ctx_instance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_login_settings_request) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetLoginSettingsResponse' @@ -450,7 +479,7 @@ def settings_service_get_login_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_login_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_login_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -459,52 +488,57 @@ def settings_service_get_login_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_login_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_login_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # GetPasswordComplexitySettings # Get the password complexity settings - # Return the password complexity settings for the requested context + # @param settings_service_get_password_complexity_settings_request [SettingsServiceGetPasswordComplexitySettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [SettingsServiceGetPasswordComplexitySettingsResponse] - def settings_service_get_password_complexity_settings(opts = {}) - data, _status_code, _headers = settings_service_get_password_complexity_settings_with_http_info(opts) + def get_password_complexity_settings(settings_service_get_password_complexity_settings_request, opts = {}) + data, _status_code, _headers = get_password_complexity_settings_with_http_info(settings_service_get_password_complexity_settings_request, opts) data end + # GetPasswordComplexitySettings # Get the password complexity settings - # Return the password complexity settings for the requested context + # @param settings_service_get_password_complexity_settings_request [SettingsServiceGetPasswordComplexitySettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [Array<(SettingsServiceGetPasswordComplexitySettingsResponse, Integer, Hash)>] SettingsServiceGetPasswordComplexitySettingsResponse data, response status code and response headers - def settings_service_get_password_complexity_settings_with_http_info(opts = {}) + def get_password_complexity_settings_with_http_info(settings_service_get_password_complexity_settings_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_password_complexity_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_password_complexity_settings ...' # MODIFIED end + # verify the required parameter 'settings_service_get_password_complexity_settings_request' is set + if @api_client.config.client_side_validation && settings_service_get_password_complexity_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'settings_service_get_password_complexity_settings_request' when calling Api::SettingsServiceApi.get_password_complexity_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings/password/complexity' + local_var_path = '/zitadel.settings.v2.SettingsService/GetPasswordComplexitySettings' # query parameters query_params = opts[:query_params] || {} - query_params[:'ctx.orgId'] = opts[:'ctx_org_id'] if !opts[:'ctx_org_id'].nil? - query_params[:'ctx.instance'] = opts[:'ctx_instance'] if !opts[:'ctx_instance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_password_complexity_settings_request) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetPasswordComplexitySettingsResponse' @@ -513,7 +547,7 @@ def settings_service_get_password_complexity_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_password_complexity_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_password_complexity_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -522,52 +556,57 @@ def settings_service_get_password_complexity_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_password_complexity_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_password_complexity_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end + # GetPasswordExpirySettings # Get the password expiry settings - # Return the password expiry settings for the requested context + # @param settings_service_get_password_expiry_settings_request [SettingsServiceGetPasswordExpirySettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [SettingsServiceGetPasswordExpirySettingsResponse] - def settings_service_get_password_expiry_settings(opts = {}) - data, _status_code, _headers = settings_service_get_password_expiry_settings_with_http_info(opts) + def get_password_expiry_settings(settings_service_get_password_expiry_settings_request, opts = {}) + data, _status_code, _headers = get_password_expiry_settings_with_http_info(settings_service_get_password_expiry_settings_request, opts) data end + # GetPasswordExpirySettings # Get the password expiry settings - # Return the password expiry settings for the requested context + # @param settings_service_get_password_expiry_settings_request [SettingsServiceGetPasswordExpirySettingsRequest] # @param [Hash] opts the optional parameters - # @option opts [String] :ctx_org_id - # @option opts [Boolean] :ctx_instance # @return [Array<(SettingsServiceGetPasswordExpirySettingsResponse, Integer, Hash)>] SettingsServiceGetPasswordExpirySettingsResponse data, response status code and response headers - def settings_service_get_password_expiry_settings_with_http_info(opts = {}) + def get_password_expiry_settings_with_http_info(settings_service_get_password_expiry_settings_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_password_expiry_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_password_expiry_settings ...' # MODIFIED end + # verify the required parameter 'settings_service_get_password_expiry_settings_request' is set + if @api_client.config.client_side_validation && settings_service_get_password_expiry_settings_request.nil? + fail ArgumentError, "Missing the required parameter 'settings_service_get_password_expiry_settings_request' when calling Api::SettingsServiceApi.get_password_expiry_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings/password/expiry' + local_var_path = '/zitadel.settings.v2.SettingsService/GetPasswordExpirySettings' # query parameters query_params = opts[:query_params] || {} - query_params[:'ctx.orgId'] = opts[:'ctx_org_id'] if !opts[:'ctx_org_id'].nil? - query_params[:'ctx.instance'] = opts[:'ctx_instance'] if !opts[:'ctx_instance'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_password_expiry_settings_request) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetPasswordExpirySettingsResponse' @@ -576,7 +615,7 @@ def settings_service_get_password_expiry_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_password_expiry_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_password_expiry_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -585,32 +624,38 @@ def settings_service_get_password_expiry_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_password_expiry_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_password_expiry_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Get Security Settings - # Returns the security settings of the ZITADEL instance. + # GetSecuritySettings + # Get the security settings + # @param body [Object] # @param [Hash] opts the optional parameters # @return [SettingsServiceGetSecuritySettingsResponse] - def settings_service_get_security_settings(opts = {}) - data, _status_code, _headers = settings_service_get_security_settings_with_http_info(opts) + def get_security_settings(body, opts = {}) + data, _status_code, _headers = get_security_settings_with_http_info(body, opts) data end - # Get Security Settings - # Returns the security settings of the ZITADEL instance. + # GetSecuritySettings + # Get the security settings + # @param body [Object] # @param [Hash] opts the optional parameters # @return [Array<(SettingsServiceGetSecuritySettingsResponse, Integer, Hash)>] SettingsServiceGetSecuritySettingsResponse data, response status code and response headers - def settings_service_get_security_settings_with_http_info(opts = {}) + def get_security_settings_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_security_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_security_settings ...' # MODIFIED end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling Api::SettingsServiceApi.get_security_settings" # MODIFIED + end # resource path - local_var_path = '/v2/settings/security' + local_var_path = '/zitadel.settings.v2.SettingsService/GetSecuritySettings' # query parameters query_params = opts[:query_params] || {} @@ -619,12 +664,17 @@ def settings_service_get_security_settings_with_http_info(opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SettingsServiceGetSecuritySettingsResponse' @@ -633,7 +683,7 @@ def settings_service_get_security_settings_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_get_security_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.get_security_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -642,38 +692,38 @@ def settings_service_get_security_settings_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_get_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Set Security Settings - # Set the security settings of the ZITADEL instance. + # SetSecuritySettings + # Set the security settings # @param settings_service_set_security_settings_request [SettingsServiceSetSecuritySettingsRequest] # @param [Hash] opts the optional parameters # @return [SettingsServiceSetSecuritySettingsResponse] - def settings_service_set_security_settings(settings_service_set_security_settings_request, opts = {}) - data, _status_code, _headers = settings_service_set_security_settings_with_http_info(settings_service_set_security_settings_request, opts) + def set_security_settings(settings_service_set_security_settings_request, opts = {}) + data, _status_code, _headers = set_security_settings_with_http_info(settings_service_set_security_settings_request, opts) data end - # Set Security Settings - # Set the security settings of the ZITADEL instance. + # SetSecuritySettings + # Set the security settings # @param settings_service_set_security_settings_request [SettingsServiceSetSecuritySettingsRequest] # @param [Hash] opts the optional parameters # @return [Array<(SettingsServiceSetSecuritySettingsResponse, Integer, Hash)>] SettingsServiceSetSecuritySettingsResponse data, response status code and response headers - def settings_service_set_security_settings_with_http_info(settings_service_set_security_settings_request, opts = {}) + def set_security_settings_with_http_info(settings_service_set_security_settings_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_set_security_settings ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.set_security_settings ...' # MODIFIED end # verify the required parameter 'settings_service_set_security_settings_request' is set if @api_client.config.client_side_validation && settings_service_set_security_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_set_security_settings_request' when calling Api::SettingsServiceApi.settings_service_set_security_settings" # MODIFIED + fail ArgumentError, "Missing the required parameter 'settings_service_set_security_settings_request' when calling Api::SettingsServiceApi.set_security_settings" # MODIFIED end # resource path - local_var_path = '/v2/policies/security' + local_var_path = '/zitadel.settings.v2.SettingsService/SetSecuritySettings' # query parameters query_params = opts[:query_params] || {} @@ -701,7 +751,7 @@ def settings_service_set_security_settings_with_http_info(settings_service_set_s auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.settings_service_set_security_settings", # MODIFIED + :operation => :"Api::SettingsServiceApi.set_security_settings", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -710,9 +760,9 @@ def settings_service_set_security_settings_with_http_info(settings_service_set_s :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + 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: Api::SettingsServiceApi#settings_service_set_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::SettingsServiceApi#set_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end diff --git a/lib/zitadel/client/api/user_service_api.rb b/lib/zitadel/client/api/user_service_api.rb index 9b0b94fe..e5cf5589 100644 --- a/lib/zitadel/client/api/user_service_api.rb +++ b/lib/zitadel/client/api/user_service_api.rb @@ -19,31 +19,31 @@ class UserServiceApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create a new human user - # Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. + # AddHumanUser + # Create a new human user Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. # @param user_service_add_human_user_request [UserServiceAddHumanUserRequest] # @param [Hash] opts the optional parameters # @return [UserServiceAddHumanUserResponse] - def user_service_add_human_user(user_service_add_human_user_request, opts = {}) - data, _status_code, _headers = user_service_add_human_user_with_http_info(user_service_add_human_user_request, opts) + def add_human_user(user_service_add_human_user_request, opts = {}) + data, _status_code, _headers = add_human_user_with_http_info(user_service_add_human_user_request, opts) data end - # Create a new human user - # Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. + # AddHumanUser + # Create a new human user Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. # @param user_service_add_human_user_request [UserServiceAddHumanUserRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceAddHumanUserResponse, Integer, Hash)>] UserServiceAddHumanUserResponse data, response status code and response headers - def user_service_add_human_user_with_http_info(user_service_add_human_user_request, opts = {}) + def add_human_user_with_http_info(user_service_add_human_user_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_add_human_user ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_human_user ...' # MODIFIED end # verify the required parameter 'user_service_add_human_user_request' is set if @api_client.config.client_side_validation && user_service_add_human_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_human_user_request' when calling Api::UserServiceApi.user_service_add_human_user" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_add_human_user_request' when calling Api::UserServiceApi.add_human_user" # MODIFIED end # resource path - local_var_path = '/v2/users/human' + local_var_path = '/zitadel.user.v2.UserService/AddHumanUser' # query parameters query_params = opts[:query_params] || {} @@ -71,7 +71,7 @@ def user_service_add_human_user_with_http_info(user_service_add_human_user_reque auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_add_human_user", # MODIFIED + :operation => :"Api::UserServiceApi.add_human_user", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -82,42 +82,36 @@ def user_service_add_human_user_with_http_info(user_service_add_human_user_reque 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: Api::UserServiceApi#user_service_add_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#add_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Add link to an identity provider to an user - # Add link to an identity provider to an user.. - # @param user_id [String] + # AddIDPLink + # Add link to an identity provider to an user Add link to an identity provider to an user.. # @param user_service_add_idp_link_request [UserServiceAddIDPLinkRequest] # @param [Hash] opts the optional parameters # @return [UserServiceAddIDPLinkResponse] - def user_service_add_idp_link(user_id, user_service_add_idp_link_request, opts = {}) - data, _status_code, _headers = user_service_add_idp_link_with_http_info(user_id, user_service_add_idp_link_request, opts) + def add_idp_link(user_service_add_idp_link_request, opts = {}) + data, _status_code, _headers = add_idp_link_with_http_info(user_service_add_idp_link_request, opts) data end - # Add link to an identity provider to an user - # Add link to an identity provider to an user.. - # @param user_id [String] + # AddIDPLink + # Add link to an identity provider to an user Add link to an identity provider to an user.. # @param user_service_add_idp_link_request [UserServiceAddIDPLinkRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceAddIDPLinkResponse, Integer, Hash)>] UserServiceAddIDPLinkResponse data, response status code and response headers - def user_service_add_idp_link_with_http_info(user_id, user_service_add_idp_link_request, opts = {}) + def add_idp_link_with_http_info(user_service_add_idp_link_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_add_idp_link ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_idp_link ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_add_idp_link" # MODIFIED - end # verify the required parameter 'user_service_add_idp_link_request' is set if @api_client.config.client_side_validation && user_service_add_idp_link_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_idp_link_request' when calling Api::UserServiceApi.user_service_add_idp_link" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_add_idp_link_request' when calling Api::UserServiceApi.add_idp_link" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/links'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/AddIDPLink' # query parameters query_params = opts[:query_params] || {} @@ -145,7 +139,7 @@ def user_service_add_idp_link_with_http_info(user_id, user_service_add_idp_link_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_add_idp_link", # MODIFIED + :operation => :"Api::UserServiceApi.add_idp_link", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -156,36 +150,36 @@ def user_service_add_idp_link_with_http_info(user_id, user_service_add_idp_link_ 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: Api::UserServiceApi#user_service_add_idp_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#add_idp_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Add OTP Email for a user - # Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. - # @param user_id [String] + # AddOTPEmail + # Add OTP Email for a user Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. + # @param user_service_add_otp_email_request [UserServiceAddOTPEmailRequest] # @param [Hash] opts the optional parameters # @return [UserServiceAddOTPEmailResponse] - def user_service_add_otp_email(user_id, opts = {}) - data, _status_code, _headers = user_service_add_otp_email_with_http_info(user_id, opts) + def add_otp_email(user_service_add_otp_email_request, opts = {}) + data, _status_code, _headers = add_otp_email_with_http_info(user_service_add_otp_email_request, opts) data end - # Add OTP Email for a user - # Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. - # @param user_id [String] + # AddOTPEmail + # Add OTP Email for a user Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. + # @param user_service_add_otp_email_request [UserServiceAddOTPEmailRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceAddOTPEmailResponse, Integer, Hash)>] UserServiceAddOTPEmailResponse data, response status code and response headers - def user_service_add_otp_email_with_http_info(user_id, opts = {}) + def add_otp_email_with_http_info(user_service_add_otp_email_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_add_otp_email ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_otp_email ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_add_otp_email" # MODIFIED + # verify the required parameter 'user_service_add_otp_email_request' is set + if @api_client.config.client_side_validation && user_service_add_otp_email_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_add_otp_email_request' when calling Api::UserServiceApi.add_otp_email" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/otp_email'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/AddOTPEmail' # query parameters query_params = opts[:query_params] || {} @@ -204,7 +198,7 @@ def user_service_add_otp_email_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_otp_email_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceAddOTPEmailResponse' @@ -213,7 +207,7 @@ def user_service_add_otp_email_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_add_otp_email", # MODIFIED + :operation => :"Api::UserServiceApi.add_otp_email", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -224,36 +218,36 @@ def user_service_add_otp_email_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_add_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#add_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Add OTP SMS for a user - # Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. - # @param user_id [String] + # AddOTPSMS + # Add OTP SMS for a user Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. + # @param user_service_add_otpsms_request [UserServiceAddOTPSMSRequest] # @param [Hash] opts the optional parameters # @return [UserServiceAddOTPSMSResponse] - def user_service_add_otpsms(user_id, opts = {}) - data, _status_code, _headers = user_service_add_otpsms_with_http_info(user_id, opts) + def add_otpsms(user_service_add_otpsms_request, opts = {}) + data, _status_code, _headers = add_otpsms_with_http_info(user_service_add_otpsms_request, opts) data end - # Add OTP SMS for a user - # Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. - # @param user_id [String] + # AddOTPSMS + # Add OTP SMS for a user Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. + # @param user_service_add_otpsms_request [UserServiceAddOTPSMSRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceAddOTPSMSResponse, Integer, Hash)>] UserServiceAddOTPSMSResponse data, response status code and response headers - def user_service_add_otpsms_with_http_info(user_id, opts = {}) + def add_otpsms_with_http_info(user_service_add_otpsms_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_add_otpsms ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_otpsms ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_add_otpsms" # MODIFIED + # verify the required parameter 'user_service_add_otpsms_request' is set + if @api_client.config.client_side_validation && user_service_add_otpsms_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_add_otpsms_request' when calling Api::UserServiceApi.add_otpsms" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/otp_sms'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/AddOTPSMS' # query parameters query_params = opts[:query_params] || {} @@ -272,7 +266,7 @@ def user_service_add_otpsms_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_otpsms_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceAddOTPSMSResponse' @@ -281,7 +275,7 @@ def user_service_add_otpsms_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_add_otpsms", # MODIFIED + :operation => :"Api::UserServiceApi.add_otpsms", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -292,42 +286,36 @@ def user_service_add_otpsms_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_add_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#add_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Create an invite code for a user - # Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. - # @param user_id [String] + # CreateInviteCode + # Create an invite code for a user Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. If an invite code has been created previously, it's url template and application name will be used as defaults for the new code. The new code will overwrite the previous one and make it invalid. # @param user_service_create_invite_code_request [UserServiceCreateInviteCodeRequest] # @param [Hash] opts the optional parameters # @return [UserServiceCreateInviteCodeResponse] - def user_service_create_invite_code(user_id, user_service_create_invite_code_request, opts = {}) - data, _status_code, _headers = user_service_create_invite_code_with_http_info(user_id, user_service_create_invite_code_request, opts) + def create_invite_code(user_service_create_invite_code_request, opts = {}) + data, _status_code, _headers = create_invite_code_with_http_info(user_service_create_invite_code_request, opts) data end - # Create an invite code for a user - # Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. - # @param user_id [String] + # CreateInviteCode + # Create an invite code for a user Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. If an invite code has been created previously, it's url template and application name will be used as defaults for the new code. The new code will overwrite the previous one and make it invalid. # @param user_service_create_invite_code_request [UserServiceCreateInviteCodeRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceCreateInviteCodeResponse, Integer, Hash)>] UserServiceCreateInviteCodeResponse data, response status code and response headers - def user_service_create_invite_code_with_http_info(user_id, user_service_create_invite_code_request, opts = {}) + def create_invite_code_with_http_info(user_service_create_invite_code_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_create_invite_code ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.create_invite_code ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_create_invite_code" # MODIFIED - end # verify the required parameter 'user_service_create_invite_code_request' is set if @api_client.config.client_side_validation && user_service_create_invite_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_create_invite_code_request' when calling Api::UserServiceApi.user_service_create_invite_code" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_create_invite_code_request' when calling Api::UserServiceApi.create_invite_code" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/invite_code'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/CreateInviteCode' # query parameters query_params = opts[:query_params] || {} @@ -355,7 +343,7 @@ def user_service_create_invite_code_with_http_info(user_id, user_service_create_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_create_invite_code", # MODIFIED + :operation => :"Api::UserServiceApi.create_invite_code", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -366,42 +354,36 @@ def user_service_create_invite_code_with_http_info(user_id, user_service_create_ 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: Api::UserServiceApi#user_service_create_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#create_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Create a passkey registration link for a user - # Create a passkey registration link which includes a code and either return it or send it to the user.. - # @param user_id [String] + # CreatePasskeyRegistrationLink + # Create a passkey registration link for a user Create a passkey registration link which includes a code and either return it or send it to the user.. # @param user_service_create_passkey_registration_link_request [UserServiceCreatePasskeyRegistrationLinkRequest] # @param [Hash] opts the optional parameters # @return [UserServiceCreatePasskeyRegistrationLinkResponse] - def user_service_create_passkey_registration_link(user_id, user_service_create_passkey_registration_link_request, opts = {}) - data, _status_code, _headers = user_service_create_passkey_registration_link_with_http_info(user_id, user_service_create_passkey_registration_link_request, opts) + def create_passkey_registration_link(user_service_create_passkey_registration_link_request, opts = {}) + data, _status_code, _headers = create_passkey_registration_link_with_http_info(user_service_create_passkey_registration_link_request, opts) data end - # Create a passkey registration link for a user - # Create a passkey registration link which includes a code and either return it or send it to the user.. - # @param user_id [String] + # CreatePasskeyRegistrationLink + # Create a passkey registration link for a user Create a passkey registration link which includes a code and either return it or send it to the user.. # @param user_service_create_passkey_registration_link_request [UserServiceCreatePasskeyRegistrationLinkRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceCreatePasskeyRegistrationLinkResponse, Integer, Hash)>] UserServiceCreatePasskeyRegistrationLinkResponse data, response status code and response headers - def user_service_create_passkey_registration_link_with_http_info(user_id, user_service_create_passkey_registration_link_request, opts = {}) + def create_passkey_registration_link_with_http_info(user_service_create_passkey_registration_link_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_create_passkey_registration_link ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.create_passkey_registration_link ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_create_passkey_registration_link" # MODIFIED - end # verify the required parameter 'user_service_create_passkey_registration_link_request' is set if @api_client.config.client_side_validation && user_service_create_passkey_registration_link_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_create_passkey_registration_link_request' when calling Api::UserServiceApi.user_service_create_passkey_registration_link" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_create_passkey_registration_link_request' when calling Api::UserServiceApi.create_passkey_registration_link" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/passkeys/registration_link'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/CreatePasskeyRegistrationLink' # query parameters query_params = opts[:query_params] || {} @@ -429,7 +411,7 @@ def user_service_create_passkey_registration_link_with_http_info(user_id, user_s auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_create_passkey_registration_link", # MODIFIED + :operation => :"Api::UserServiceApi.create_passkey_registration_link", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -440,36 +422,36 @@ def user_service_create_passkey_registration_link_with_http_info(user_id, user_s 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: Api::UserServiceApi#user_service_create_passkey_registration_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#create_passkey_registration_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Deactivate user - # The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. - # @param user_id [String] + # DeactivateUser + # Deactivate user The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. + # @param user_service_deactivate_user_request [UserServiceDeactivateUserRequest] # @param [Hash] opts the optional parameters # @return [UserServiceDeactivateUserResponse] - def user_service_deactivate_user(user_id, opts = {}) - data, _status_code, _headers = user_service_deactivate_user_with_http_info(user_id, opts) + def deactivate_user(user_service_deactivate_user_request, opts = {}) + data, _status_code, _headers = deactivate_user_with_http_info(user_service_deactivate_user_request, opts) data end - # Deactivate user - # The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. - # @param user_id [String] + # DeactivateUser + # Deactivate user The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. + # @param user_service_deactivate_user_request [UserServiceDeactivateUserRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceDeactivateUserResponse, Integer, Hash)>] UserServiceDeactivateUserResponse data, response status code and response headers - def user_service_deactivate_user_with_http_info(user_id, opts = {}) + def deactivate_user_with_http_info(user_service_deactivate_user_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_deactivate_user ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.deactivate_user ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_deactivate_user" # MODIFIED + # verify the required parameter 'user_service_deactivate_user_request' is set + if @api_client.config.client_side_validation && user_service_deactivate_user_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_deactivate_user_request' when calling Api::UserServiceApi.deactivate_user" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/deactivate'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/DeactivateUser' # query parameters query_params = opts[:query_params] || {} @@ -488,7 +470,7 @@ def user_service_deactivate_user_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_deactivate_user_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceDeactivateUserResponse' @@ -497,7 +479,7 @@ def user_service_deactivate_user_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_deactivate_user", # MODIFIED + :operation => :"Api::UserServiceApi.deactivate_user", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -508,36 +490,36 @@ def user_service_deactivate_user_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_deactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#deactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Delete user - # The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. - # @param user_id [String] + # DeleteUser + # Delete user The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. + # @param user_service_delete_user_request [UserServiceDeleteUserRequest] # @param [Hash] opts the optional parameters # @return [UserServiceDeleteUserResponse] - def user_service_delete_user(user_id, opts = {}) - data, _status_code, _headers = user_service_delete_user_with_http_info(user_id, opts) + def delete_user(user_service_delete_user_request, opts = {}) + data, _status_code, _headers = delete_user_with_http_info(user_service_delete_user_request, opts) data end - # Delete user - # The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. - # @param user_id [String] + # DeleteUser + # Delete user The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. + # @param user_service_delete_user_request [UserServiceDeleteUserRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceDeleteUserResponse, Integer, Hash)>] UserServiceDeleteUserResponse data, response status code and response headers - def user_service_delete_user_with_http_info(user_id, opts = {}) + def delete_user_with_http_info(user_service_delete_user_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_delete_user ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.delete_user ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_delete_user" # MODIFIED + # verify the required parameter 'user_service_delete_user_request' is set + if @api_client.config.client_side_validation && user_service_delete_user_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_delete_user_request' when calling Api::UserServiceApi.delete_user" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/DeleteUser' # query parameters query_params = opts[:query_params] || {} @@ -546,12 +528,17 @@ def user_service_delete_user_with_http_info(user_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_delete_user_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceDeleteUserResponse' @@ -560,7 +547,7 @@ def user_service_delete_user_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_delete_user", # MODIFIED + :operation => :"Api::UserServiceApi.delete_user", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -569,38 +556,38 @@ def user_service_delete_user_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # User by ID - # Returns the full user object (human or machine) including the profile, email, etc.. - # @param user_id [String] User ID of the user you like to get. + # GetUserByID + # User by ID Returns the full user object (human or machine) including the profile, email, etc.. + # @param user_service_get_user_by_id_request [UserServiceGetUserByIDRequest] # @param [Hash] opts the optional parameters # @return [UserServiceGetUserByIDResponse] - def user_service_get_user_by_id(user_id, opts = {}) - data, _status_code, _headers = user_service_get_user_by_id_with_http_info(user_id, opts) + def get_user_by_id(user_service_get_user_by_id_request, opts = {}) + data, _status_code, _headers = get_user_by_id_with_http_info(user_service_get_user_by_id_request, opts) data end - # User by ID - # Returns the full user object (human or machine) including the profile, email, etc.. - # @param user_id [String] User ID of the user you like to get. + # GetUserByID + # User by ID Returns the full user object (human or machine) including the profile, email, etc.. + # @param user_service_get_user_by_id_request [UserServiceGetUserByIDRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceGetUserByIDResponse, Integer, Hash)>] UserServiceGetUserByIDResponse data, response status code and response headers - def user_service_get_user_by_id_with_http_info(user_id, opts = {}) + def get_user_by_id_with_http_info(user_service_get_user_by_id_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_get_user_by_id ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.get_user_by_id ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_get_user_by_id" # MODIFIED + # verify the required parameter 'user_service_get_user_by_id_request' is set + if @api_client.config.client_side_validation && user_service_get_user_by_id_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_get_user_by_id_request' when calling Api::UserServiceApi.get_user_by_id" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/GetUserByID' # query parameters query_params = opts[:query_params] || {} @@ -609,12 +596,17 @@ def user_service_get_user_by_id_with_http_info(user_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_get_user_by_id_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceGetUserByIDResponse' @@ -623,7 +615,7 @@ def user_service_get_user_by_id_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_get_user_by_id", # MODIFIED + :operation => :"Api::UserServiceApi.get_user_by_id", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -632,38 +624,38 @@ def user_service_get_user_by_id_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_get_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#get_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # MFA Init Skipped - # Update the last time the user has skipped MFA initialization. The server timestamp is used. - # @param user_id [String] + # HumanMFAInitSkipped + # MFA Init Skipped Update the last time the user has skipped MFA initialization. The server timestamp is used. + # @param user_service_human_mfa_init_skipped_request [UserServiceHumanMFAInitSkippedRequest] # @param [Hash] opts the optional parameters # @return [UserServiceHumanMFAInitSkippedResponse] - def user_service_human_mfa_init_skipped(user_id, opts = {}) - data, _status_code, _headers = user_service_human_mfa_init_skipped_with_http_info(user_id, opts) + def human_mfa_init_skipped(user_service_human_mfa_init_skipped_request, opts = {}) + data, _status_code, _headers = human_mfa_init_skipped_with_http_info(user_service_human_mfa_init_skipped_request, opts) data end - # MFA Init Skipped - # Update the last time the user has skipped MFA initialization. The server timestamp is used. - # @param user_id [String] + # HumanMFAInitSkipped + # MFA Init Skipped Update the last time the user has skipped MFA initialization. The server timestamp is used. + # @param user_service_human_mfa_init_skipped_request [UserServiceHumanMFAInitSkippedRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceHumanMFAInitSkippedResponse, Integer, Hash)>] UserServiceHumanMFAInitSkippedResponse data, response status code and response headers - def user_service_human_mfa_init_skipped_with_http_info(user_id, opts = {}) + def human_mfa_init_skipped_with_http_info(user_service_human_mfa_init_skipped_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_human_mfa_init_skipped ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.human_mfa_init_skipped ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_human_mfa_init_skipped" # MODIFIED + # verify the required parameter 'user_service_human_mfa_init_skipped_request' is set + if @api_client.config.client_side_validation && user_service_human_mfa_init_skipped_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_human_mfa_init_skipped_request' when calling Api::UserServiceApi.human_mfa_init_skipped" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/mfa_init_skipped'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/HumanMFAInitSkipped' # query parameters query_params = opts[:query_params] || {} @@ -682,7 +674,7 @@ def user_service_human_mfa_init_skipped_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_human_mfa_init_skipped_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceHumanMFAInitSkippedResponse' @@ -691,7 +683,7 @@ def user_service_human_mfa_init_skipped_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_human_mfa_init_skipped", # MODIFIED + :operation => :"Api::UserServiceApi.human_mfa_init_skipped", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -702,60 +694,53 @@ def user_service_human_mfa_init_skipped_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_human_mfa_init_skipped\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#human_mfa_init_skipped\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # @param user_id [String] + # ListAuthenticationFactors + # @param user_service_list_authentication_factors_request [UserServiceListAuthenticationFactorsRequest] # @param [Hash] opts the optional parameters - # @option opts [Array] :auth_factors Specify the Auth Factors you are interested in - # @option opts [Array] :states Specify the state of the Auth Factors # @return [UserServiceListAuthenticationFactorsResponse] - def user_service_list_authentication_factors(user_id, opts = {}) - data, _status_code, _headers = user_service_list_authentication_factors_with_http_info(user_id, opts) + def list_authentication_factors(user_service_list_authentication_factors_request, opts = {}) + data, _status_code, _headers = list_authentication_factors_with_http_info(user_service_list_authentication_factors_request, opts) data end - # @param user_id [String] + # ListAuthenticationFactors + # @param user_service_list_authentication_factors_request [UserServiceListAuthenticationFactorsRequest] # @param [Hash] opts the optional parameters - # @option opts [Array] :auth_factors Specify the Auth Factors you are interested in - # @option opts [Array] :states Specify the state of the Auth Factors # @return [Array<(UserServiceListAuthenticationFactorsResponse, Integer, Hash)>] UserServiceListAuthenticationFactorsResponse data, response status code and response headers - def user_service_list_authentication_factors_with_http_info(user_id, opts = {}) + def list_authentication_factors_with_http_info(user_service_list_authentication_factors_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_list_authentication_factors ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_authentication_factors ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_list_authentication_factors" # MODIFIED + # verify the required parameter 'user_service_list_authentication_factors_request' is set + if @api_client.config.client_side_validation && user_service_list_authentication_factors_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_list_authentication_factors_request' when calling Api::UserServiceApi.list_authentication_factors" # MODIFIED end - allowable_values = ["OTP", "OTP_SMS", "OTP_EMAIL", "U2F"] - if @api_client.config.client_side_validation && opts[:'auth_factors'] && !opts[:'auth_factors'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"auth_factors\", must include one of #{allowable_values}" - end - allowable_values = ["AUTH_FACTOR_STATE_UNSPECIFIED", "AUTH_FACTOR_STATE_NOT_READY", "AUTH_FACTOR_STATE_READY", "AUTH_FACTOR_STATE_REMOVED"] - if @api_client.config.client_side_validation && opts[:'states'] && !opts[:'states'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"states\", must include one of #{allowable_values}" - end # resource path - local_var_path = '/v2/users/{userId}/authentication_factors/_search'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/ListAuthenticationFactors' # query parameters query_params = opts[:query_params] || {} - query_params[:'authFactors'] = @api_client.build_collection_param(opts[:'auth_factors'], :csv) if !opts[:'auth_factors'].nil? - query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :csv) if !opts[:'states'].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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_authentication_factors_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceListAuthenticationFactorsResponse' @@ -764,7 +749,7 @@ def user_service_list_authentication_factors_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_list_authentication_factors", # MODIFIED + :operation => :"Api::UserServiceApi.list_authentication_factors", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -775,56 +760,55 @@ def user_service_list_authentication_factors_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_list_authentication_factors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#list_authentication_factors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # List all possible authentication methods of a user - # List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. - # @param user_id [String] + # ListAuthenticationMethodTypes + # List all possible authentication methods of a user List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. + # @param user_service_list_authentication_method_types_request [UserServiceListAuthenticationMethodTypesRequest] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :domain_query_include_without_domain List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. - # @option opts [String] :domain_query_domain List only auth methods with specific domain. # @return [UserServiceListAuthenticationMethodTypesResponse] - def user_service_list_authentication_method_types(user_id, opts = {}) - data, _status_code, _headers = user_service_list_authentication_method_types_with_http_info(user_id, opts) + def list_authentication_method_types(user_service_list_authentication_method_types_request, opts = {}) + data, _status_code, _headers = list_authentication_method_types_with_http_info(user_service_list_authentication_method_types_request, opts) data end - # List all possible authentication methods of a user - # List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. - # @param user_id [String] + # ListAuthenticationMethodTypes + # List all possible authentication methods of a user List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. + # @param user_service_list_authentication_method_types_request [UserServiceListAuthenticationMethodTypesRequest] # @param [Hash] opts the optional parameters - # @option opts [Boolean] :domain_query_include_without_domain List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. - # @option opts [String] :domain_query_domain List only auth methods with specific domain. # @return [Array<(UserServiceListAuthenticationMethodTypesResponse, Integer, Hash)>] UserServiceListAuthenticationMethodTypesResponse data, response status code and response headers - def user_service_list_authentication_method_types_with_http_info(user_id, opts = {}) + def list_authentication_method_types_with_http_info(user_service_list_authentication_method_types_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_list_authentication_method_types ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_authentication_method_types ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_list_authentication_method_types" # MODIFIED + # verify the required parameter 'user_service_list_authentication_method_types_request' is set + if @api_client.config.client_side_validation && user_service_list_authentication_method_types_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_list_authentication_method_types_request' when calling Api::UserServiceApi.list_authentication_method_types" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/authentication_methods'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/ListAuthenticationMethodTypes' # query parameters query_params = opts[:query_params] || {} - query_params[:'domainQuery.includeWithoutDomain'] = opts[:'domain_query_include_without_domain'] if !opts[:'domain_query_include_without_domain'].nil? - query_params[:'domainQuery.domain'] = opts[:'domain_query_domain'] if !opts[:'domain_query_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'] + # 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_authentication_method_types_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceListAuthenticationMethodTypesResponse' @@ -833,7 +817,7 @@ def user_service_list_authentication_method_types_with_http_info(user_id, opts = auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_list_authentication_method_types", # MODIFIED + :operation => :"Api::UserServiceApi.list_authentication_method_types", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -842,44 +826,38 @@ def user_service_list_authentication_method_types_with_http_info(user_id, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_list_authentication_method_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#list_authentication_method_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # List links to an identity provider of an user - # List links to an identity provider of an user. - # @param user_id [String] + # ListIDPLinks + # List links to an identity provider of an user List links to an identity provider of an user. # @param user_service_list_idp_links_request [UserServiceListIDPLinksRequest] # @param [Hash] opts the optional parameters # @return [UserServiceListIDPLinksResponse] - def user_service_list_idp_links(user_id, user_service_list_idp_links_request, opts = {}) - data, _status_code, _headers = user_service_list_idp_links_with_http_info(user_id, user_service_list_idp_links_request, opts) + def list_idp_links(user_service_list_idp_links_request, opts = {}) + data, _status_code, _headers = list_idp_links_with_http_info(user_service_list_idp_links_request, opts) data end - # List links to an identity provider of an user - # List links to an identity provider of an user. - # @param user_id [String] + # ListIDPLinks + # List links to an identity provider of an user List links to an identity provider of an user. # @param user_service_list_idp_links_request [UserServiceListIDPLinksRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceListIDPLinksResponse, Integer, Hash)>] UserServiceListIDPLinksResponse data, response status code and response headers - def user_service_list_idp_links_with_http_info(user_id, user_service_list_idp_links_request, opts = {}) + def list_idp_links_with_http_info(user_service_list_idp_links_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_list_idp_links ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_idp_links ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_list_idp_links" # MODIFIED - end # verify the required parameter 'user_service_list_idp_links_request' is set if @api_client.config.client_side_validation && user_service_list_idp_links_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_idp_links_request' when calling Api::UserServiceApi.user_service_list_idp_links" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_list_idp_links_request' when calling Api::UserServiceApi.list_idp_links" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/links/_search'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/ListIDPLinks' # query parameters query_params = opts[:query_params] || {} @@ -907,7 +885,7 @@ def user_service_list_idp_links_with_http_info(user_id, user_service_list_idp_li auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_list_idp_links", # MODIFIED + :operation => :"Api::UserServiceApi.list_idp_links", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -918,36 +896,36 @@ def user_service_list_idp_links_with_http_info(user_id, user_service_list_idp_li 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: Api::UserServiceApi#user_service_list_idp_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#list_idp_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # List passkeys of an user - # List passkeys of an user - # @param user_id [String] + # ListPasskeys + # List passkeys of an user List passkeys of an user + # @param user_service_list_passkeys_request [UserServiceListPasskeysRequest] # @param [Hash] opts the optional parameters # @return [UserServiceListPasskeysResponse] - def user_service_list_passkeys(user_id, opts = {}) - data, _status_code, _headers = user_service_list_passkeys_with_http_info(user_id, opts) + def list_passkeys(user_service_list_passkeys_request, opts = {}) + data, _status_code, _headers = list_passkeys_with_http_info(user_service_list_passkeys_request, opts) data end - # List passkeys of an user - # List passkeys of an user - # @param user_id [String] + # ListPasskeys + # List passkeys of an user List passkeys of an user + # @param user_service_list_passkeys_request [UserServiceListPasskeysRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceListPasskeysResponse, Integer, Hash)>] UserServiceListPasskeysResponse data, response status code and response headers - def user_service_list_passkeys_with_http_info(user_id, opts = {}) + def list_passkeys_with_http_info(user_service_list_passkeys_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_list_passkeys ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_passkeys ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_list_passkeys" # MODIFIED + # verify the required parameter 'user_service_list_passkeys_request' is set + if @api_client.config.client_side_validation && user_service_list_passkeys_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_list_passkeys_request' when calling Api::UserServiceApi.list_passkeys" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/passkeys/_search'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/ListPasskeys' # query parameters query_params = opts[:query_params] || {} @@ -966,7 +944,7 @@ def user_service_list_passkeys_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_passkeys_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceListPasskeysResponse' @@ -975,7 +953,7 @@ def user_service_list_passkeys_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_list_passkeys", # MODIFIED + :operation => :"Api::UserServiceApi.list_passkeys", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -986,36 +964,36 @@ def user_service_list_passkeys_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_list_passkeys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#list_passkeys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Search Users - # Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. + # ListUsers + # Search Users Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. # @param user_service_list_users_request [UserServiceListUsersRequest] # @param [Hash] opts the optional parameters # @return [UserServiceListUsersResponse] - def user_service_list_users(user_service_list_users_request, opts = {}) - data, _status_code, _headers = user_service_list_users_with_http_info(user_service_list_users_request, opts) + def list_users(user_service_list_users_request, opts = {}) + data, _status_code, _headers = list_users_with_http_info(user_service_list_users_request, opts) data end - # Search Users - # Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. + # ListUsers + # Search Users Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. # @param user_service_list_users_request [UserServiceListUsersRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceListUsersResponse, Integer, Hash)>] UserServiceListUsersResponse data, response status code and response headers - def user_service_list_users_with_http_info(user_service_list_users_request, opts = {}) + def list_users_with_http_info(user_service_list_users_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_list_users ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_users ...' # MODIFIED end # verify the required parameter 'user_service_list_users_request' is set if @api_client.config.client_side_validation && user_service_list_users_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_users_request' when calling Api::UserServiceApi.user_service_list_users" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_list_users_request' when calling Api::UserServiceApi.list_users" # MODIFIED end # resource path - local_var_path = '/v2/users' + local_var_path = '/zitadel.user.v2.UserService/ListUsers' # query parameters query_params = opts[:query_params] || {} @@ -1043,7 +1021,7 @@ def user_service_list_users_with_http_info(user_service_list_users_request, opts auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_list_users", # MODIFIED + :operation => :"Api::UserServiceApi.list_users", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1054,36 +1032,36 @@ def user_service_list_users_with_http_info(user_service_list_users_request, opts 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: Api::UserServiceApi#user_service_list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Lock user - # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - # @param user_id [String] + # LockUser + # Lock user The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. + # @param user_service_lock_user_request [UserServiceLockUserRequest] # @param [Hash] opts the optional parameters # @return [UserServiceLockUserResponse] - def user_service_lock_user(user_id, opts = {}) - data, _status_code, _headers = user_service_lock_user_with_http_info(user_id, opts) + def lock_user(user_service_lock_user_request, opts = {}) + data, _status_code, _headers = lock_user_with_http_info(user_service_lock_user_request, opts) data end - # Lock user - # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - # @param user_id [String] + # LockUser + # Lock user The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. + # @param user_service_lock_user_request [UserServiceLockUserRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceLockUserResponse, Integer, Hash)>] UserServiceLockUserResponse data, response status code and response headers - def user_service_lock_user_with_http_info(user_id, opts = {}) + def lock_user_with_http_info(user_service_lock_user_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_lock_user ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.lock_user ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_lock_user" # MODIFIED + # verify the required parameter 'user_service_lock_user_request' is set + if @api_client.config.client_side_validation && user_service_lock_user_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_lock_user_request' when calling Api::UserServiceApi.lock_user" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/lock'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/LockUser' # query parameters query_params = opts[:query_params] || {} @@ -1102,7 +1080,7 @@ def user_service_lock_user_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_lock_user_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceLockUserResponse' @@ -1111,7 +1089,7 @@ def user_service_lock_user_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_lock_user", # MODIFIED + :operation => :"Api::UserServiceApi.lock_user", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1122,42 +1100,36 @@ def user_service_lock_user_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_lock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#lock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Request a code to reset a password - # Request a code to reset a password.. - # @param user_id [String] + # PasswordReset + # Request a code to reset a password Request a code to reset a password.. # @param user_service_password_reset_request [UserServicePasswordResetRequest] # @param [Hash] opts the optional parameters # @return [UserServicePasswordResetResponse] - def user_service_password_reset(user_id, user_service_password_reset_request, opts = {}) - data, _status_code, _headers = user_service_password_reset_with_http_info(user_id, user_service_password_reset_request, opts) + def password_reset(user_service_password_reset_request, opts = {}) + data, _status_code, _headers = password_reset_with_http_info(user_service_password_reset_request, opts) data end - # Request a code to reset a password - # Request a code to reset a password.. - # @param user_id [String] + # PasswordReset + # Request a code to reset a password Request a code to reset a password.. # @param user_service_password_reset_request [UserServicePasswordResetRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServicePasswordResetResponse, Integer, Hash)>] UserServicePasswordResetResponse data, response status code and response headers - def user_service_password_reset_with_http_info(user_id, user_service_password_reset_request, opts = {}) + def password_reset_with_http_info(user_service_password_reset_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_password_reset ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.password_reset ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_password_reset" # MODIFIED - end # verify the required parameter 'user_service_password_reset_request' is set if @api_client.config.client_side_validation && user_service_password_reset_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_password_reset_request' when calling Api::UserServiceApi.user_service_password_reset" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_password_reset_request' when calling Api::UserServiceApi.password_reset" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/password_reset'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/PasswordReset' # query parameters query_params = opts[:query_params] || {} @@ -1185,7 +1157,7 @@ def user_service_password_reset_with_http_info(user_id, user_service_password_re auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_password_reset", # MODIFIED + :operation => :"Api::UserServiceApi.password_reset", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1196,36 +1168,36 @@ def user_service_password_reset_with_http_info(user_id, user_service_password_re 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: Api::UserServiceApi#user_service_password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Reactivate user - # Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. - # @param user_id [String] + # ReactivateUser + # Reactivate user Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. + # @param user_service_reactivate_user_request [UserServiceReactivateUserRequest] # @param [Hash] opts the optional parameters # @return [UserServiceReactivateUserResponse] - def user_service_reactivate_user(user_id, opts = {}) - data, _status_code, _headers = user_service_reactivate_user_with_http_info(user_id, opts) + def reactivate_user(user_service_reactivate_user_request, opts = {}) + data, _status_code, _headers = reactivate_user_with_http_info(user_service_reactivate_user_request, opts) data end - # Reactivate user - # Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. - # @param user_id [String] + # ReactivateUser + # Reactivate user Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. + # @param user_service_reactivate_user_request [UserServiceReactivateUserRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceReactivateUserResponse, Integer, Hash)>] UserServiceReactivateUserResponse data, response status code and response headers - def user_service_reactivate_user_with_http_info(user_id, opts = {}) + def reactivate_user_with_http_info(user_service_reactivate_user_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_reactivate_user ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.reactivate_user ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_reactivate_user" # MODIFIED + # verify the required parameter 'user_service_reactivate_user_request' is set + if @api_client.config.client_side_validation && user_service_reactivate_user_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_reactivate_user_request' when calling Api::UserServiceApi.reactivate_user" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/reactivate'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/ReactivateUser' # query parameters query_params = opts[:query_params] || {} @@ -1244,7 +1216,7 @@ def user_service_reactivate_user_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_reactivate_user_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceReactivateUserResponse' @@ -1253,7 +1225,7 @@ def user_service_reactivate_user_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_reactivate_user", # MODIFIED + :operation => :"Api::UserServiceApi.reactivate_user", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1264,42 +1236,36 @@ def user_service_reactivate_user_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_reactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#reactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Start the registration of passkey for a user - # Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. - # @param user_id [String] + # RegisterPasskey + # Start the registration of passkey for a user Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. # @param user_service_register_passkey_request [UserServiceRegisterPasskeyRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRegisterPasskeyResponse] - def user_service_register_passkey(user_id, user_service_register_passkey_request, opts = {}) - data, _status_code, _headers = user_service_register_passkey_with_http_info(user_id, user_service_register_passkey_request, opts) + def register_passkey(user_service_register_passkey_request, opts = {}) + data, _status_code, _headers = register_passkey_with_http_info(user_service_register_passkey_request, opts) data end - # Start the registration of passkey for a user - # Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. - # @param user_id [String] + # RegisterPasskey + # Start the registration of passkey for a user Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. # @param user_service_register_passkey_request [UserServiceRegisterPasskeyRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRegisterPasskeyResponse, Integer, Hash)>] UserServiceRegisterPasskeyResponse data, response status code and response headers - def user_service_register_passkey_with_http_info(user_id, user_service_register_passkey_request, opts = {}) + def register_passkey_with_http_info(user_service_register_passkey_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_register_passkey ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.register_passkey ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_register_passkey" # MODIFIED - end # verify the required parameter 'user_service_register_passkey_request' is set if @api_client.config.client_side_validation && user_service_register_passkey_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_register_passkey_request' when calling Api::UserServiceApi.user_service_register_passkey" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_register_passkey_request' when calling Api::UserServiceApi.register_passkey" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/passkeys'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RegisterPasskey' # query parameters query_params = opts[:query_params] || {} @@ -1327,7 +1293,7 @@ def user_service_register_passkey_with_http_info(user_id, user_service_register_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_register_passkey", # MODIFIED + :operation => :"Api::UserServiceApi.register_passkey", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1338,36 +1304,36 @@ def user_service_register_passkey_with_http_info(user_id, user_service_register_ 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: Api::UserServiceApi#user_service_register_passkey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#register_passkey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Start the registration of a TOTP generator for a user - # Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. - # @param user_id [String] + # RegisterTOTP + # Start the registration of a TOTP generator for a user Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. + # @param user_service_register_totp_request [UserServiceRegisterTOTPRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRegisterTOTPResponse] - def user_service_register_totp(user_id, opts = {}) - data, _status_code, _headers = user_service_register_totp_with_http_info(user_id, opts) + def register_totp(user_service_register_totp_request, opts = {}) + data, _status_code, _headers = register_totp_with_http_info(user_service_register_totp_request, opts) data end - # Start the registration of a TOTP generator for a user - # Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. - # @param user_id [String] + # RegisterTOTP + # Start the registration of a TOTP generator for a user Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. + # @param user_service_register_totp_request [UserServiceRegisterTOTPRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRegisterTOTPResponse, Integer, Hash)>] UserServiceRegisterTOTPResponse data, response status code and response headers - def user_service_register_totp_with_http_info(user_id, opts = {}) + def register_totp_with_http_info(user_service_register_totp_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_register_totp ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.register_totp ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_register_totp" # MODIFIED + # verify the required parameter 'user_service_register_totp_request' is set + if @api_client.config.client_side_validation && user_service_register_totp_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_register_totp_request' when calling Api::UserServiceApi.register_totp" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/totp'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RegisterTOTP' # query parameters query_params = opts[:query_params] || {} @@ -1386,7 +1352,7 @@ def user_service_register_totp_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_register_totp_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceRegisterTOTPResponse' @@ -1395,7 +1361,7 @@ def user_service_register_totp_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_register_totp", # MODIFIED + :operation => :"Api::UserServiceApi.register_totp", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1406,42 +1372,36 @@ def user_service_register_totp_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_register_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#register_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Start the registration of a u2f token for a user - # Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. - # @param user_id [String] + # RegisterU2F + # Start the registration of a u2f token for a user Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. # @param user_service_register_u2_f_request [UserServiceRegisterU2FRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRegisterU2FResponse] - def user_service_register_u2_f(user_id, user_service_register_u2_f_request, opts = {}) - data, _status_code, _headers = user_service_register_u2_f_with_http_info(user_id, user_service_register_u2_f_request, opts) + def register_u2_f(user_service_register_u2_f_request, opts = {}) + data, _status_code, _headers = register_u2_f_with_http_info(user_service_register_u2_f_request, opts) data end - # Start the registration of a u2f token for a user - # Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. - # @param user_id [String] + # RegisterU2F + # Start the registration of a u2f token for a user Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. # @param user_service_register_u2_f_request [UserServiceRegisterU2FRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRegisterU2FResponse, Integer, Hash)>] UserServiceRegisterU2FResponse data, response status code and response headers - def user_service_register_u2_f_with_http_info(user_id, user_service_register_u2_f_request, opts = {}) + def register_u2_f_with_http_info(user_service_register_u2_f_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_register_u2_f ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.register_u2_f ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_register_u2_f" # MODIFIED - end # verify the required parameter 'user_service_register_u2_f_request' is set if @api_client.config.client_side_validation && user_service_register_u2_f_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_register_u2_f_request' when calling Api::UserServiceApi.user_service_register_u2_f" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_register_u2_f_request' when calling Api::UserServiceApi.register_u2_f" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/u2f'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RegisterU2F' # query parameters query_params = opts[:query_params] || {} @@ -1469,7 +1429,7 @@ def user_service_register_u2_f_with_http_info(user_id, user_service_register_u2_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_register_u2_f", # MODIFIED + :operation => :"Api::UserServiceApi.register_u2_f", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1480,48 +1440,36 @@ def user_service_register_u2_f_with_http_info(user_id, user_service_register_u2_ 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: Api::UserServiceApi#user_service_register_u2_f\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#register_u2_f\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Remove link of an identity provider to an user - # Remove link of an identity provider to an user. - # @param user_id [String] - # @param idp_id [String] - # @param linked_user_id [String] + # RemoveIDPLink + # Remove link of an identity provider to an user Remove link of an identity provider to an user. + # @param user_service_remove_idp_link_request [UserServiceRemoveIDPLinkRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRemoveIDPLinkResponse] - def user_service_remove_idp_link(user_id, idp_id, linked_user_id, opts = {}) - data, _status_code, _headers = user_service_remove_idp_link_with_http_info(user_id, idp_id, linked_user_id, opts) + def remove_idp_link(user_service_remove_idp_link_request, opts = {}) + data, _status_code, _headers = remove_idp_link_with_http_info(user_service_remove_idp_link_request, opts) data end - # Remove link of an identity provider to an user - # Remove link of an identity provider to an user. - # @param user_id [String] - # @param idp_id [String] - # @param linked_user_id [String] + # RemoveIDPLink + # Remove link of an identity provider to an user Remove link of an identity provider to an user. + # @param user_service_remove_idp_link_request [UserServiceRemoveIDPLinkRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRemoveIDPLinkResponse, Integer, Hash)>] UserServiceRemoveIDPLinkResponse data, response status code and response headers - def user_service_remove_idp_link_with_http_info(user_id, idp_id, linked_user_id, opts = {}) + def remove_idp_link_with_http_info(user_service_remove_idp_link_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_remove_idp_link ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_idp_link ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_remove_idp_link" # MODIFIED - end - # verify the required parameter 'idp_id' is set - if @api_client.config.client_side_validation && idp_id.nil? - fail ArgumentError, "Missing the required parameter 'idp_id' when calling Api::UserServiceApi.user_service_remove_idp_link" # MODIFIED - end - # verify the required parameter 'linked_user_id' is set - if @api_client.config.client_side_validation && linked_user_id.nil? - fail ArgumentError, "Missing the required parameter 'linked_user_id' when calling Api::UserServiceApi.user_service_remove_idp_link" # MODIFIED + # verify the required parameter 'user_service_remove_idp_link_request' is set + if @api_client.config.client_side_validation && user_service_remove_idp_link_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_remove_idp_link_request' when calling Api::UserServiceApi.remove_idp_link" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/links/{idpId}/{linkedUserId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)).sub('{' + 'idpId' + '}', CGI.escape(idp_id.to_s)).sub('{' + 'linkedUserId' + '}', CGI.escape(linked_user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RemoveIDPLink' # query parameters query_params = opts[:query_params] || {} @@ -1540,7 +1488,7 @@ def user_service_remove_idp_link_with_http_info(user_id, idp_id, linked_user_id, form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_idp_link_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceRemoveIDPLinkResponse' @@ -1549,7 +1497,7 @@ def user_service_remove_idp_link_with_http_info(user_id, idp_id, linked_user_id, auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_remove_idp_link", # MODIFIED + :operation => :"Api::UserServiceApi.remove_idp_link", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1558,38 +1506,38 @@ def user_service_remove_idp_link_with_http_info(user_id, idp_id, linked_user_id, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_remove_idp_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_idp_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Remove One-Time Password (OTP) Email from a user - # Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. - # @param user_id [String] + # RemoveOTPEmail + # Remove One-Time Password (OTP) Email from a user Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. + # @param user_service_remove_otp_email_request [UserServiceRemoveOTPEmailRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRemoveOTPEmailResponse] - def user_service_remove_otp_email(user_id, opts = {}) - data, _status_code, _headers = user_service_remove_otp_email_with_http_info(user_id, opts) + def remove_otp_email(user_service_remove_otp_email_request, opts = {}) + data, _status_code, _headers = remove_otp_email_with_http_info(user_service_remove_otp_email_request, opts) data end - # Remove One-Time Password (OTP) Email from a user - # Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. - # @param user_id [String] + # RemoveOTPEmail + # Remove One-Time Password (OTP) Email from a user Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. + # @param user_service_remove_otp_email_request [UserServiceRemoveOTPEmailRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRemoveOTPEmailResponse, Integer, Hash)>] UserServiceRemoveOTPEmailResponse data, response status code and response headers - def user_service_remove_otp_email_with_http_info(user_id, opts = {}) + def remove_otp_email_with_http_info(user_service_remove_otp_email_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_remove_otp_email ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_otp_email ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_remove_otp_email" # MODIFIED + # verify the required parameter 'user_service_remove_otp_email_request' is set + if @api_client.config.client_side_validation && user_service_remove_otp_email_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_remove_otp_email_request' when calling Api::UserServiceApi.remove_otp_email" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/otp_email'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RemoveOTPEmail' # query parameters query_params = opts[:query_params] || {} @@ -1598,12 +1546,17 @@ def user_service_remove_otp_email_with_http_info(user_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_otp_email_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceRemoveOTPEmailResponse' @@ -1612,7 +1565,7 @@ def user_service_remove_otp_email_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_remove_otp_email", # MODIFIED + :operation => :"Api::UserServiceApi.remove_otp_email", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1621,38 +1574,38 @@ def user_service_remove_otp_email_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_remove_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Remove One-Time Password (OTP) SMS from a user - # Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. - # @param user_id [String] + # RemoveOTPSMS + # Remove One-Time Password (OTP) SMS from a user Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. + # @param user_service_remove_otpsms_request [UserServiceRemoveOTPSMSRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRemoveOTPSMSResponse] - def user_service_remove_otpsms(user_id, opts = {}) - data, _status_code, _headers = user_service_remove_otpsms_with_http_info(user_id, opts) + def remove_otpsms(user_service_remove_otpsms_request, opts = {}) + data, _status_code, _headers = remove_otpsms_with_http_info(user_service_remove_otpsms_request, opts) data end - # Remove One-Time Password (OTP) SMS from a user - # Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. - # @param user_id [String] + # RemoveOTPSMS + # Remove One-Time Password (OTP) SMS from a user Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. + # @param user_service_remove_otpsms_request [UserServiceRemoveOTPSMSRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRemoveOTPSMSResponse, Integer, Hash)>] UserServiceRemoveOTPSMSResponse data, response status code and response headers - def user_service_remove_otpsms_with_http_info(user_id, opts = {}) + def remove_otpsms_with_http_info(user_service_remove_otpsms_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_remove_otpsms ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_otpsms ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_remove_otpsms" # MODIFIED + # verify the required parameter 'user_service_remove_otpsms_request' is set + if @api_client.config.client_side_validation && user_service_remove_otpsms_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_remove_otpsms_request' when calling Api::UserServiceApi.remove_otpsms" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/otp_sms'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RemoveOTPSMS' # query parameters query_params = opts[:query_params] || {} @@ -1661,12 +1614,17 @@ def user_service_remove_otpsms_with_http_info(user_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_otpsms_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceRemoveOTPSMSResponse' @@ -1675,7 +1633,7 @@ def user_service_remove_otpsms_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_remove_otpsms", # MODIFIED + :operation => :"Api::UserServiceApi.remove_otpsms", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1684,44 +1642,38 @@ def user_service_remove_otpsms_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_remove_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Remove passkey from a user - # Remove passkey from a user. - # @param user_id [String] - # @param passkey_id [String] + # RemovePasskey + # Remove passkey from a user Remove passkey from a user. + # @param user_service_remove_passkey_request [UserServiceRemovePasskeyRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRemovePasskeyResponse] - def user_service_remove_passkey(user_id, passkey_id, opts = {}) - data, _status_code, _headers = user_service_remove_passkey_with_http_info(user_id, passkey_id, opts) + def remove_passkey(user_service_remove_passkey_request, opts = {}) + data, _status_code, _headers = remove_passkey_with_http_info(user_service_remove_passkey_request, opts) data end - # Remove passkey from a user - # Remove passkey from a user. - # @param user_id [String] - # @param passkey_id [String] + # RemovePasskey + # Remove passkey from a user Remove passkey from a user. + # @param user_service_remove_passkey_request [UserServiceRemovePasskeyRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRemovePasskeyResponse, Integer, Hash)>] UserServiceRemovePasskeyResponse data, response status code and response headers - def user_service_remove_passkey_with_http_info(user_id, passkey_id, opts = {}) + def remove_passkey_with_http_info(user_service_remove_passkey_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_remove_passkey ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_passkey ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_remove_passkey" # MODIFIED - end - # verify the required parameter 'passkey_id' is set - if @api_client.config.client_side_validation && passkey_id.nil? - fail ArgumentError, "Missing the required parameter 'passkey_id' when calling Api::UserServiceApi.user_service_remove_passkey" # MODIFIED + # verify the required parameter 'user_service_remove_passkey_request' is set + if @api_client.config.client_side_validation && user_service_remove_passkey_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_remove_passkey_request' when calling Api::UserServiceApi.remove_passkey" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/passkeys/{passkeyId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)).sub('{' + 'passkeyId' + '}', CGI.escape(passkey_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RemovePasskey' # query parameters query_params = opts[:query_params] || {} @@ -1730,12 +1682,17 @@ def user_service_remove_passkey_with_http_info(user_id, passkey_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_passkey_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceRemovePasskeyResponse' @@ -1744,7 +1701,7 @@ def user_service_remove_passkey_with_http_info(user_id, passkey_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_remove_passkey", # MODIFIED + :operation => :"Api::UserServiceApi.remove_passkey", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1753,38 +1710,38 @@ def user_service_remove_passkey_with_http_info(user_id, passkey_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_remove_passkey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_passkey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Delete the user phone - # Delete the phone number of a user. - # @param user_id [String] + # RemovePhone + # Remove the user phone Remove the user phone + # @param user_service_remove_phone_request [UserServiceRemovePhoneRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRemovePhoneResponse] - def user_service_remove_phone(user_id, opts = {}) - data, _status_code, _headers = user_service_remove_phone_with_http_info(user_id, opts) + def remove_phone(user_service_remove_phone_request, opts = {}) + data, _status_code, _headers = remove_phone_with_http_info(user_service_remove_phone_request, opts) data end - # Delete the user phone - # Delete the phone number of a user. - # @param user_id [String] + # RemovePhone + # Remove the user phone Remove the user phone + # @param user_service_remove_phone_request [UserServiceRemovePhoneRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRemovePhoneResponse, Integer, Hash)>] UserServiceRemovePhoneResponse data, response status code and response headers - def user_service_remove_phone_with_http_info(user_id, opts = {}) + def remove_phone_with_http_info(user_service_remove_phone_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_remove_phone ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_phone ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_remove_phone" # MODIFIED + # verify the required parameter 'user_service_remove_phone_request' is set + if @api_client.config.client_side_validation && user_service_remove_phone_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_remove_phone_request' when calling Api::UserServiceApi.remove_phone" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/phone'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RemovePhone' # query parameters query_params = opts[:query_params] || {} @@ -1803,7 +1760,7 @@ def user_service_remove_phone_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_phone_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceRemovePhoneResponse' @@ -1812,7 +1769,7 @@ def user_service_remove_phone_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_remove_phone", # MODIFIED + :operation => :"Api::UserServiceApi.remove_phone", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1821,38 +1778,38 @@ def user_service_remove_phone_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_remove_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Remove TOTP generator from a user - # Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. - # @param user_id [String] + # RemoveTOTP + # Remove TOTP generator from a user Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. + # @param user_service_remove_totp_request [UserServiceRemoveTOTPRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRemoveTOTPResponse] - def user_service_remove_totp(user_id, opts = {}) - data, _status_code, _headers = user_service_remove_totp_with_http_info(user_id, opts) + def remove_totp(user_service_remove_totp_request, opts = {}) + data, _status_code, _headers = remove_totp_with_http_info(user_service_remove_totp_request, opts) data end - # Remove TOTP generator from a user - # Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. - # @param user_id [String] + # RemoveTOTP + # Remove TOTP generator from a user Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. + # @param user_service_remove_totp_request [UserServiceRemoveTOTPRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRemoveTOTPResponse, Integer, Hash)>] UserServiceRemoveTOTPResponse data, response status code and response headers - def user_service_remove_totp_with_http_info(user_id, opts = {}) + def remove_totp_with_http_info(user_service_remove_totp_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_remove_totp ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_totp ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_remove_totp" # MODIFIED + # verify the required parameter 'user_service_remove_totp_request' is set + if @api_client.config.client_side_validation && user_service_remove_totp_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_remove_totp_request' when calling Api::UserServiceApi.remove_totp" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/totp'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RemoveTOTP' # query parameters query_params = opts[:query_params] || {} @@ -1861,12 +1818,17 @@ def user_service_remove_totp_with_http_info(user_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_totp_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceRemoveTOTPResponse' @@ -1875,7 +1837,7 @@ def user_service_remove_totp_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_remove_totp", # MODIFIED + :operation => :"Api::UserServiceApi.remove_totp", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1884,44 +1846,38 @@ def user_service_remove_totp_with_http_info(user_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_remove_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Remove u2f token from a user - # Remove u2f token from a user - # @param user_id [String] - # @param u2f_id [String] + # RemoveU2F + # Remove u2f token from a user Remove u2f token from a user. + # @param user_service_remove_u2_f_request [UserServiceRemoveU2FRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRemoveU2FResponse] - def user_service_remove_u2_f(user_id, u2f_id, opts = {}) - data, _status_code, _headers = user_service_remove_u2_f_with_http_info(user_id, u2f_id, opts) + def remove_u2_f(user_service_remove_u2_f_request, opts = {}) + data, _status_code, _headers = remove_u2_f_with_http_info(user_service_remove_u2_f_request, opts) data end - # Remove u2f token from a user - # Remove u2f token from a user - # @param user_id [String] - # @param u2f_id [String] + # RemoveU2F + # Remove u2f token from a user Remove u2f token from a user. + # @param user_service_remove_u2_f_request [UserServiceRemoveU2FRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRemoveU2FResponse, Integer, Hash)>] UserServiceRemoveU2FResponse data, response status code and response headers - def user_service_remove_u2_f_with_http_info(user_id, u2f_id, opts = {}) + def remove_u2_f_with_http_info(user_service_remove_u2_f_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_remove_u2_f ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_u2_f ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_remove_u2_f" # MODIFIED - end - # verify the required parameter 'u2f_id' is set - if @api_client.config.client_side_validation && u2f_id.nil? - fail ArgumentError, "Missing the required parameter 'u2f_id' when calling Api::UserServiceApi.user_service_remove_u2_f" # MODIFIED + # verify the required parameter 'user_service_remove_u2_f_request' is set + if @api_client.config.client_side_validation && user_service_remove_u2_f_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_remove_u2_f_request' when calling Api::UserServiceApi.remove_u2_f" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/u2f/{u2fId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)).sub('{' + 'u2fId' + '}', CGI.escape(u2f_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RemoveU2F' # query parameters query_params = opts[:query_params] || {} @@ -1930,12 +1886,17 @@ def user_service_remove_u2_f_with_http_info(user_id, u2f_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_u2_f_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceRemoveU2FResponse' @@ -1944,7 +1905,7 @@ def user_service_remove_u2_f_with_http_info(user_id, u2f_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_remove_u2_f", # MODIFIED + :operation => :"Api::UserServiceApi.remove_u2_f", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1953,44 +1914,38 @@ def user_service_remove_u2_f_with_http_info(user_id, u2f_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_remove_u2_f\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_u2_f\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Resend code to verify user email - # Resend code to verify user email. - # @param user_id [String] + # ResendEmailCode + # Resend code to verify user email Resend code to verify user email. # @param user_service_resend_email_code_request [UserServiceResendEmailCodeRequest] # @param [Hash] opts the optional parameters # @return [UserServiceResendEmailCodeResponse] - def user_service_resend_email_code(user_id, user_service_resend_email_code_request, opts = {}) - data, _status_code, _headers = user_service_resend_email_code_with_http_info(user_id, user_service_resend_email_code_request, opts) + def resend_email_code(user_service_resend_email_code_request, opts = {}) + data, _status_code, _headers = resend_email_code_with_http_info(user_service_resend_email_code_request, opts) data end - # Resend code to verify user email - # Resend code to verify user email. - # @param user_id [String] + # ResendEmailCode + # Resend code to verify user email Resend code to verify user email. # @param user_service_resend_email_code_request [UserServiceResendEmailCodeRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceResendEmailCodeResponse, Integer, Hash)>] UserServiceResendEmailCodeResponse data, response status code and response headers - def user_service_resend_email_code_with_http_info(user_id, user_service_resend_email_code_request, opts = {}) + def resend_email_code_with_http_info(user_service_resend_email_code_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_resend_email_code ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.resend_email_code ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_resend_email_code" # MODIFIED - end # verify the required parameter 'user_service_resend_email_code_request' is set if @api_client.config.client_side_validation && user_service_resend_email_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_resend_email_code_request' when calling Api::UserServiceApi.user_service_resend_email_code" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_resend_email_code_request' when calling Api::UserServiceApi.resend_email_code" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/email/resend'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/ResendEmailCode' # query parameters query_params = opts[:query_params] || {} @@ -2018,7 +1973,7 @@ def user_service_resend_email_code_with_http_info(user_id, user_service_resend_e auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_resend_email_code", # MODIFIED + :operation => :"Api::UserServiceApi.resend_email_code", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2029,36 +1984,36 @@ def user_service_resend_email_code_with_http_info(user_id, user_service_resend_e 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: Api::UserServiceApi#user_service_resend_email_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#resend_email_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Resend an invite code for a user - # Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. - # @param user_id [String] + # ResendInviteCode + # Resend an invite code for a user Deprecated: Use [CreateInviteCode](apis/resources/user_service_v2/user-service-create-invite-code.api.mdx) instead. Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. + # @param user_service_resend_invite_code_request [UserServiceResendInviteCodeRequest] # @param [Hash] opts the optional parameters # @return [UserServiceResendInviteCodeResponse] - def user_service_resend_invite_code(user_id, opts = {}) - data, _status_code, _headers = user_service_resend_invite_code_with_http_info(user_id, opts) + def resend_invite_code(user_service_resend_invite_code_request, opts = {}) + data, _status_code, _headers = resend_invite_code_with_http_info(user_service_resend_invite_code_request, opts) data end - # Resend an invite code for a user - # Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. - # @param user_id [String] + # ResendInviteCode + # Resend an invite code for a user Deprecated: Use [CreateInviteCode](apis/resources/user_service_v2/user-service-create-invite-code.api.mdx) instead. Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. + # @param user_service_resend_invite_code_request [UserServiceResendInviteCodeRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceResendInviteCodeResponse, Integer, Hash)>] UserServiceResendInviteCodeResponse data, response status code and response headers - def user_service_resend_invite_code_with_http_info(user_id, opts = {}) + def resend_invite_code_with_http_info(user_service_resend_invite_code_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_resend_invite_code ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.resend_invite_code ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_resend_invite_code" # MODIFIED + # verify the required parameter 'user_service_resend_invite_code_request' is set + if @api_client.config.client_side_validation && user_service_resend_invite_code_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_resend_invite_code_request' when calling Api::UserServiceApi.resend_invite_code" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/invite_code/resend'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/ResendInviteCode' # query parameters query_params = opts[:query_params] || {} @@ -2067,12 +2022,17 @@ def user_service_resend_invite_code_with_http_info(user_id, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_resend_invite_code_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceResendInviteCodeResponse' @@ -2081,7 +2041,7 @@ def user_service_resend_invite_code_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_resend_invite_code", # MODIFIED + :operation => :"Api::UserServiceApi.resend_invite_code", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2092,42 +2052,36 @@ def user_service_resend_invite_code_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_resend_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#resend_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Resend code to verify user phone - # Resend code to verify user phone. - # @param user_id [String] + # ResendPhoneCode + # Resend code to verify user phone Resend code to verify user phone. # @param user_service_resend_phone_code_request [UserServiceResendPhoneCodeRequest] # @param [Hash] opts the optional parameters # @return [UserServiceResendPhoneCodeResponse] - def user_service_resend_phone_code(user_id, user_service_resend_phone_code_request, opts = {}) - data, _status_code, _headers = user_service_resend_phone_code_with_http_info(user_id, user_service_resend_phone_code_request, opts) + def resend_phone_code(user_service_resend_phone_code_request, opts = {}) + data, _status_code, _headers = resend_phone_code_with_http_info(user_service_resend_phone_code_request, opts) data end - # Resend code to verify user phone - # Resend code to verify user phone. - # @param user_id [String] + # ResendPhoneCode + # Resend code to verify user phone Resend code to verify user phone. # @param user_service_resend_phone_code_request [UserServiceResendPhoneCodeRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceResendPhoneCodeResponse, Integer, Hash)>] UserServiceResendPhoneCodeResponse data, response status code and response headers - def user_service_resend_phone_code_with_http_info(user_id, user_service_resend_phone_code_request, opts = {}) + def resend_phone_code_with_http_info(user_service_resend_phone_code_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_resend_phone_code ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.resend_phone_code ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_resend_phone_code" # MODIFIED - end # verify the required parameter 'user_service_resend_phone_code_request' is set if @api_client.config.client_side_validation && user_service_resend_phone_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_resend_phone_code_request' when calling Api::UserServiceApi.user_service_resend_phone_code" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_resend_phone_code_request' when calling Api::UserServiceApi.resend_phone_code" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/phone/resend'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/ResendPhoneCode' # query parameters query_params = opts[:query_params] || {} @@ -2155,7 +2109,7 @@ def user_service_resend_phone_code_with_http_info(user_id, user_service_resend_p auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_resend_phone_code", # MODIFIED + :operation => :"Api::UserServiceApi.resend_phone_code", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2166,42 +2120,36 @@ def user_service_resend_phone_code_with_http_info(user_id, user_service_resend_p 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: Api::UserServiceApi#user_service_resend_phone_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#resend_phone_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Retrieve the information returned by the identity provider - # Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. - # @param idp_intent_id [String] ID of the idp intent, previously returned on the success response of the IDP callback + # RetrieveIdentityProviderIntent + # Retrieve the information returned by the identity provider Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. # @param user_service_retrieve_identity_provider_intent_request [UserServiceRetrieveIdentityProviderIntentRequest] # @param [Hash] opts the optional parameters # @return [UserServiceRetrieveIdentityProviderIntentResponse] - def user_service_retrieve_identity_provider_intent(idp_intent_id, user_service_retrieve_identity_provider_intent_request, opts = {}) - data, _status_code, _headers = user_service_retrieve_identity_provider_intent_with_http_info(idp_intent_id, user_service_retrieve_identity_provider_intent_request, opts) + def retrieve_identity_provider_intent(user_service_retrieve_identity_provider_intent_request, opts = {}) + data, _status_code, _headers = retrieve_identity_provider_intent_with_http_info(user_service_retrieve_identity_provider_intent_request, opts) data end - # Retrieve the information returned by the identity provider - # Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. - # @param idp_intent_id [String] ID of the idp intent, previously returned on the success response of the IDP callback + # RetrieveIdentityProviderIntent + # Retrieve the information returned by the identity provider Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. # @param user_service_retrieve_identity_provider_intent_request [UserServiceRetrieveIdentityProviderIntentRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceRetrieveIdentityProviderIntentResponse, Integer, Hash)>] UserServiceRetrieveIdentityProviderIntentResponse data, response status code and response headers - def user_service_retrieve_identity_provider_intent_with_http_info(idp_intent_id, user_service_retrieve_identity_provider_intent_request, opts = {}) + def retrieve_identity_provider_intent_with_http_info(user_service_retrieve_identity_provider_intent_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_retrieve_identity_provider_intent ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.retrieve_identity_provider_intent ...' # MODIFIED end - # verify the required parameter 'idp_intent_id' is set - if @api_client.config.client_side_validation && idp_intent_id.nil? - fail ArgumentError, "Missing the required parameter 'idp_intent_id' when calling Api::UserServiceApi.user_service_retrieve_identity_provider_intent" # MODIFIED - end # verify the required parameter 'user_service_retrieve_identity_provider_intent_request' is set if @api_client.config.client_side_validation && user_service_retrieve_identity_provider_intent_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_retrieve_identity_provider_intent_request' when calling Api::UserServiceApi.user_service_retrieve_identity_provider_intent" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_retrieve_identity_provider_intent_request' when calling Api::UserServiceApi.retrieve_identity_provider_intent" # MODIFIED end # resource path - local_var_path = '/v2/idp_intents/{idpIntentId}'.sub('{' + 'idpIntentId' + '}', CGI.escape(idp_intent_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/RetrieveIdentityProviderIntent' # query parameters query_params = opts[:query_params] || {} @@ -2229,7 +2177,7 @@ def user_service_retrieve_identity_provider_intent_with_http_info(idp_intent_id, auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_retrieve_identity_provider_intent", # MODIFIED + :operation => :"Api::UserServiceApi.retrieve_identity_provider_intent", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2240,42 +2188,36 @@ def user_service_retrieve_identity_provider_intent_with_http_info(idp_intent_id, 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: Api::UserServiceApi#user_service_retrieve_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#retrieve_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Send code to verify user email - # Send code to verify user email. - # @param user_id [String] + # SendEmailCode + # Send code to verify user email Send code to verify user email. # @param user_service_send_email_code_request [UserServiceSendEmailCodeRequest] # @param [Hash] opts the optional parameters # @return [UserServiceSendEmailCodeResponse] - def user_service_send_email_code(user_id, user_service_send_email_code_request, opts = {}) - data, _status_code, _headers = user_service_send_email_code_with_http_info(user_id, user_service_send_email_code_request, opts) + def send_email_code(user_service_send_email_code_request, opts = {}) + data, _status_code, _headers = send_email_code_with_http_info(user_service_send_email_code_request, opts) data end - # Send code to verify user email - # Send code to verify user email. - # @param user_id [String] + # SendEmailCode + # Send code to verify user email Send code to verify user email. # @param user_service_send_email_code_request [UserServiceSendEmailCodeRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceSendEmailCodeResponse, Integer, Hash)>] UserServiceSendEmailCodeResponse data, response status code and response headers - def user_service_send_email_code_with_http_info(user_id, user_service_send_email_code_request, opts = {}) + def send_email_code_with_http_info(user_service_send_email_code_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_send_email_code ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.send_email_code ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_send_email_code" # MODIFIED - end # verify the required parameter 'user_service_send_email_code_request' is set if @api_client.config.client_side_validation && user_service_send_email_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_send_email_code_request' when calling Api::UserServiceApi.user_service_send_email_code" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_send_email_code_request' when calling Api::UserServiceApi.send_email_code" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/email/send'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/SendEmailCode' # query parameters query_params = opts[:query_params] || {} @@ -2303,7 +2245,7 @@ def user_service_send_email_code_with_http_info(user_id, user_service_send_email auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_send_email_code", # MODIFIED + :operation => :"Api::UserServiceApi.send_email_code", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2314,42 +2256,36 @@ def user_service_send_email_code_with_http_info(user_id, user_service_send_email 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: Api::UserServiceApi#user_service_send_email_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#send_email_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Change the user email - # Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. - # @param user_id [String] + # SetEmail + # Change the user email Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. # @param user_service_set_email_request [UserServiceSetEmailRequest] # @param [Hash] opts the optional parameters # @return [UserServiceSetEmailResponse] - def user_service_set_email(user_id, user_service_set_email_request, opts = {}) - data, _status_code, _headers = user_service_set_email_with_http_info(user_id, user_service_set_email_request, opts) + def set_email(user_service_set_email_request, opts = {}) + data, _status_code, _headers = set_email_with_http_info(user_service_set_email_request, opts) data end - # Change the user email - # Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. - # @param user_id [String] + # SetEmail + # Change the user email Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. # @param user_service_set_email_request [UserServiceSetEmailRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceSetEmailResponse, Integer, Hash)>] UserServiceSetEmailResponse data, response status code and response headers - def user_service_set_email_with_http_info(user_id, user_service_set_email_request, opts = {}) + def set_email_with_http_info(user_service_set_email_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_set_email ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.set_email ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_set_email" # MODIFIED - end # verify the required parameter 'user_service_set_email_request' is set if @api_client.config.client_side_validation && user_service_set_email_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_set_email_request' when calling Api::UserServiceApi.user_service_set_email" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_set_email_request' when calling Api::UserServiceApi.set_email" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/email'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/SetEmail' # query parameters query_params = opts[:query_params] || {} @@ -2377,7 +2313,7 @@ def user_service_set_email_with_http_info(user_id, user_service_set_email_reques auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_set_email", # MODIFIED + :operation => :"Api::UserServiceApi.set_email", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2388,42 +2324,36 @@ def user_service_set_email_with_http_info(user_id, user_service_set_email_reques 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: Api::UserServiceApi#user_service_set_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#set_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Change password - # Change the password of a user with either a verification code or the current password.. - # @param user_id [String] + # SetPassword + # Change password Change the password of a user with either a verification code or the current password.. # @param user_service_set_password_request [UserServiceSetPasswordRequest] # @param [Hash] opts the optional parameters # @return [UserServiceSetPasswordResponse] - def user_service_set_password(user_id, user_service_set_password_request, opts = {}) - data, _status_code, _headers = user_service_set_password_with_http_info(user_id, user_service_set_password_request, opts) + def set_password(user_service_set_password_request, opts = {}) + data, _status_code, _headers = set_password_with_http_info(user_service_set_password_request, opts) data end - # Change password - # Change the password of a user with either a verification code or the current password.. - # @param user_id [String] + # SetPassword + # Change password Change the password of a user with either a verification code or the current password.. # @param user_service_set_password_request [UserServiceSetPasswordRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceSetPasswordResponse, Integer, Hash)>] UserServiceSetPasswordResponse data, response status code and response headers - def user_service_set_password_with_http_info(user_id, user_service_set_password_request, opts = {}) + def set_password_with_http_info(user_service_set_password_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_set_password ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.set_password ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_set_password" # MODIFIED - end # verify the required parameter 'user_service_set_password_request' is set if @api_client.config.client_side_validation && user_service_set_password_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_set_password_request' when calling Api::UserServiceApi.user_service_set_password" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_set_password_request' when calling Api::UserServiceApi.set_password" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/password'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/SetPassword' # query parameters query_params = opts[:query_params] || {} @@ -2451,7 +2381,7 @@ def user_service_set_password_with_http_info(user_id, user_service_set_password_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_set_password", # MODIFIED + :operation => :"Api::UserServiceApi.set_password", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2462,42 +2392,36 @@ def user_service_set_password_with_http_info(user_id, user_service_set_password_ 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: Api::UserServiceApi#user_service_set_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#set_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Set the user phone - # Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. - # @param user_id [String] + # SetPhone + # Set the user phone Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. # @param user_service_set_phone_request [UserServiceSetPhoneRequest] # @param [Hash] opts the optional parameters # @return [UserServiceSetPhoneResponse] - def user_service_set_phone(user_id, user_service_set_phone_request, opts = {}) - data, _status_code, _headers = user_service_set_phone_with_http_info(user_id, user_service_set_phone_request, opts) + def set_phone(user_service_set_phone_request, opts = {}) + data, _status_code, _headers = set_phone_with_http_info(user_service_set_phone_request, opts) data end - # Set the user phone - # Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. - # @param user_id [String] + # SetPhone + # Set the user phone Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. # @param user_service_set_phone_request [UserServiceSetPhoneRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceSetPhoneResponse, Integer, Hash)>] UserServiceSetPhoneResponse data, response status code and response headers - def user_service_set_phone_with_http_info(user_id, user_service_set_phone_request, opts = {}) + def set_phone_with_http_info(user_service_set_phone_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_set_phone ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.set_phone ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_set_phone" # MODIFIED - end # verify the required parameter 'user_service_set_phone_request' is set if @api_client.config.client_side_validation && user_service_set_phone_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_set_phone_request' when calling Api::UserServiceApi.user_service_set_phone" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_set_phone_request' when calling Api::UserServiceApi.set_phone" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/phone'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/SetPhone' # query parameters query_params = opts[:query_params] || {} @@ -2525,7 +2449,7 @@ def user_service_set_phone_with_http_info(user_id, user_service_set_phone_reques auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_set_phone", # MODIFIED + :operation => :"Api::UserServiceApi.set_phone", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2536,36 +2460,36 @@ def user_service_set_phone_with_http_info(user_id, user_service_set_phone_reques 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: Api::UserServiceApi#user_service_set_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#set_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Start flow with an identity provider - # Start a flow with an identity provider, for external login, registration or linking.. + # StartIdentityProviderIntent + # Start flow with an identity provider Start a flow with an identity provider, for external login, registration or linking.. # @param user_service_start_identity_provider_intent_request [UserServiceStartIdentityProviderIntentRequest] # @param [Hash] opts the optional parameters # @return [UserServiceStartIdentityProviderIntentResponse] - def user_service_start_identity_provider_intent(user_service_start_identity_provider_intent_request, opts = {}) - data, _status_code, _headers = user_service_start_identity_provider_intent_with_http_info(user_service_start_identity_provider_intent_request, opts) + def start_identity_provider_intent(user_service_start_identity_provider_intent_request, opts = {}) + data, _status_code, _headers = start_identity_provider_intent_with_http_info(user_service_start_identity_provider_intent_request, opts) data end - # Start flow with an identity provider - # Start a flow with an identity provider, for external login, registration or linking.. + # StartIdentityProviderIntent + # Start flow with an identity provider Start a flow with an identity provider, for external login, registration or linking.. # @param user_service_start_identity_provider_intent_request [UserServiceStartIdentityProviderIntentRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceStartIdentityProviderIntentResponse, Integer, Hash)>] UserServiceStartIdentityProviderIntentResponse data, response status code and response headers - def user_service_start_identity_provider_intent_with_http_info(user_service_start_identity_provider_intent_request, opts = {}) + def start_identity_provider_intent_with_http_info(user_service_start_identity_provider_intent_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_start_identity_provider_intent ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.start_identity_provider_intent ...' # MODIFIED end # verify the required parameter 'user_service_start_identity_provider_intent_request' is set if @api_client.config.client_side_validation && user_service_start_identity_provider_intent_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_start_identity_provider_intent_request' when calling Api::UserServiceApi.user_service_start_identity_provider_intent" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_start_identity_provider_intent_request' when calling Api::UserServiceApi.start_identity_provider_intent" # MODIFIED end # resource path - local_var_path = '/v2/idp_intents' + local_var_path = '/zitadel.user.v2.UserService/StartIdentityProviderIntent' # query parameters query_params = opts[:query_params] || {} @@ -2593,7 +2517,7 @@ def user_service_start_identity_provider_intent_with_http_info(user_service_star auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_start_identity_provider_intent", # MODIFIED + :operation => :"Api::UserServiceApi.start_identity_provider_intent", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2604,36 +2528,36 @@ def user_service_start_identity_provider_intent_with_http_info(user_service_star 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: Api::UserServiceApi#user_service_start_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#start_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Unlock user - # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - # @param user_id [String] + # UnlockUser + # Unlock user The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. + # @param user_service_unlock_user_request [UserServiceUnlockUserRequest] # @param [Hash] opts the optional parameters # @return [UserServiceUnlockUserResponse] - def user_service_unlock_user(user_id, opts = {}) - data, _status_code, _headers = user_service_unlock_user_with_http_info(user_id, opts) + def unlock_user(user_service_unlock_user_request, opts = {}) + data, _status_code, _headers = unlock_user_with_http_info(user_service_unlock_user_request, opts) data end - # Unlock user - # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - # @param user_id [String] + # UnlockUser + # Unlock user The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. + # @param user_service_unlock_user_request [UserServiceUnlockUserRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceUnlockUserResponse, Integer, Hash)>] UserServiceUnlockUserResponse data, response status code and response headers - def user_service_unlock_user_with_http_info(user_id, opts = {}) + def unlock_user_with_http_info(user_service_unlock_user_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_unlock_user ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.unlock_user ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_unlock_user" # MODIFIED + # verify the required parameter 'user_service_unlock_user_request' is set + if @api_client.config.client_side_validation && user_service_unlock_user_request.nil? + fail ArgumentError, "Missing the required parameter 'user_service_unlock_user_request' when calling Api::UserServiceApi.unlock_user" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/unlock'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/UnlockUser' # query parameters query_params = opts[:query_params] || {} @@ -2652,7 +2576,7 @@ def user_service_unlock_user_with_http_info(user_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_unlock_user_request) # return_type return_type = opts[:debug_return_type] || 'UserServiceUnlockUserResponse' @@ -2661,7 +2585,7 @@ def user_service_unlock_user_with_http_info(user_id, opts = {}) auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_unlock_user", # MODIFIED + :operation => :"Api::UserServiceApi.unlock_user", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2672,42 +2596,36 @@ def user_service_unlock_user_with_http_info(user_id, opts = {}) 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: Api::UserServiceApi#user_service_unlock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#unlock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Update User - # Update all information from a user.. - # @param user_id [String] + # UpdateHumanUser + # Update User Update all information from a user.. # @param user_service_update_human_user_request [UserServiceUpdateHumanUserRequest] # @param [Hash] opts the optional parameters # @return [UserServiceUpdateHumanUserResponse] - def user_service_update_human_user(user_id, user_service_update_human_user_request, opts = {}) - data, _status_code, _headers = user_service_update_human_user_with_http_info(user_id, user_service_update_human_user_request, opts) + def update_human_user(user_service_update_human_user_request, opts = {}) + data, _status_code, _headers = update_human_user_with_http_info(user_service_update_human_user_request, opts) data end - # Update User - # Update all information from a user.. - # @param user_id [String] + # UpdateHumanUser + # Update User Update all information from a user.. # @param user_service_update_human_user_request [UserServiceUpdateHumanUserRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceUpdateHumanUserResponse, Integer, Hash)>] UserServiceUpdateHumanUserResponse data, response status code and response headers - def user_service_update_human_user_with_http_info(user_id, user_service_update_human_user_request, opts = {}) + def update_human_user_with_http_info(user_service_update_human_user_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_update_human_user ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.update_human_user ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_update_human_user" # MODIFIED - end # verify the required parameter 'user_service_update_human_user_request' is set if @api_client.config.client_side_validation && user_service_update_human_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_update_human_user_request' when calling Api::UserServiceApi.user_service_update_human_user" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_update_human_user_request' when calling Api::UserServiceApi.update_human_user" # MODIFIED end # resource path - local_var_path = '/v2/users/human/{userId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/UpdateHumanUser' # query parameters query_params = opts[:query_params] || {} @@ -2735,7 +2653,7 @@ def user_service_update_human_user_with_http_info(user_id, user_service_update_h auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_update_human_user", # MODIFIED + :operation => :"Api::UserServiceApi.update_human_user", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2744,44 +2662,38 @@ def user_service_update_human_user_with_http_info(user_id, user_service_update_h :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + 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: Api::UserServiceApi#user_service_update_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#update_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Verify the email - # Verify the email with the generated code. - # @param user_id [String] + # VerifyEmail + # Verify the email Verify the email with the generated code. # @param user_service_verify_email_request [UserServiceVerifyEmailRequest] # @param [Hash] opts the optional parameters # @return [UserServiceVerifyEmailResponse] - def user_service_verify_email(user_id, user_service_verify_email_request, opts = {}) - data, _status_code, _headers = user_service_verify_email_with_http_info(user_id, user_service_verify_email_request, opts) + def verify_email(user_service_verify_email_request, opts = {}) + data, _status_code, _headers = verify_email_with_http_info(user_service_verify_email_request, opts) data end - # Verify the email - # Verify the email with the generated code. - # @param user_id [String] + # VerifyEmail + # Verify the email Verify the email with the generated code. # @param user_service_verify_email_request [UserServiceVerifyEmailRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceVerifyEmailResponse, Integer, Hash)>] UserServiceVerifyEmailResponse data, response status code and response headers - def user_service_verify_email_with_http_info(user_id, user_service_verify_email_request, opts = {}) + def verify_email_with_http_info(user_service_verify_email_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_verify_email ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_email ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_verify_email" # MODIFIED - end # verify the required parameter 'user_service_verify_email_request' is set if @api_client.config.client_side_validation && user_service_verify_email_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_email_request' when calling Api::UserServiceApi.user_service_verify_email" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_verify_email_request' when calling Api::UserServiceApi.verify_email" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/email/verify'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/VerifyEmail' # query parameters query_params = opts[:query_params] || {} @@ -2809,7 +2721,7 @@ def user_service_verify_email_with_http_info(user_id, user_service_verify_email_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_verify_email", # MODIFIED + :operation => :"Api::UserServiceApi.verify_email", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2820,42 +2732,36 @@ def user_service_verify_email_with_http_info(user_id, user_service_verify_email_ 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: Api::UserServiceApi#user_service_verify_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Verify an invite code for a user - # Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. - # @param user_id [String] + # VerifyInviteCode + # Verify an invite code for a user Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. # @param user_service_verify_invite_code_request [UserServiceVerifyInviteCodeRequest] # @param [Hash] opts the optional parameters # @return [UserServiceVerifyInviteCodeResponse] - def user_service_verify_invite_code(user_id, user_service_verify_invite_code_request, opts = {}) - data, _status_code, _headers = user_service_verify_invite_code_with_http_info(user_id, user_service_verify_invite_code_request, opts) + def verify_invite_code(user_service_verify_invite_code_request, opts = {}) + data, _status_code, _headers = verify_invite_code_with_http_info(user_service_verify_invite_code_request, opts) data end - # Verify an invite code for a user - # Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. - # @param user_id [String] + # VerifyInviteCode + # Verify an invite code for a user Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. # @param user_service_verify_invite_code_request [UserServiceVerifyInviteCodeRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceVerifyInviteCodeResponse, Integer, Hash)>] UserServiceVerifyInviteCodeResponse data, response status code and response headers - def user_service_verify_invite_code_with_http_info(user_id, user_service_verify_invite_code_request, opts = {}) + def verify_invite_code_with_http_info(user_service_verify_invite_code_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_verify_invite_code ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_invite_code ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_verify_invite_code" # MODIFIED - end # verify the required parameter 'user_service_verify_invite_code_request' is set if @api_client.config.client_side_validation && user_service_verify_invite_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_invite_code_request' when calling Api::UserServiceApi.user_service_verify_invite_code" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_verify_invite_code_request' when calling Api::UserServiceApi.verify_invite_code" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/invite_code/verify'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/VerifyInviteCode' # query parameters query_params = opts[:query_params] || {} @@ -2883,7 +2789,7 @@ def user_service_verify_invite_code_with_http_info(user_id, user_service_verify_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_verify_invite_code", # MODIFIED + :operation => :"Api::UserServiceApi.verify_invite_code", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2894,48 +2800,36 @@ def user_service_verify_invite_code_with_http_info(user_id, user_service_verify_ 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: Api::UserServiceApi#user_service_verify_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Verify a passkey for a user - # Verify the passkey registration with the public key credential.. - # @param user_id [String] - # @param passkey_id [String] + # VerifyPasskeyRegistration + # Verify a passkey for a user Verify the passkey registration with the public key credential.. # @param user_service_verify_passkey_registration_request [UserServiceVerifyPasskeyRegistrationRequest] # @param [Hash] opts the optional parameters # @return [UserServiceVerifyPasskeyRegistrationResponse] - def user_service_verify_passkey_registration(user_id, passkey_id, user_service_verify_passkey_registration_request, opts = {}) - data, _status_code, _headers = user_service_verify_passkey_registration_with_http_info(user_id, passkey_id, user_service_verify_passkey_registration_request, opts) + def verify_passkey_registration(user_service_verify_passkey_registration_request, opts = {}) + data, _status_code, _headers = verify_passkey_registration_with_http_info(user_service_verify_passkey_registration_request, opts) data end - # Verify a passkey for a user - # Verify the passkey registration with the public key credential.. - # @param user_id [String] - # @param passkey_id [String] + # VerifyPasskeyRegistration + # Verify a passkey for a user Verify the passkey registration with the public key credential.. # @param user_service_verify_passkey_registration_request [UserServiceVerifyPasskeyRegistrationRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceVerifyPasskeyRegistrationResponse, Integer, Hash)>] UserServiceVerifyPasskeyRegistrationResponse data, response status code and response headers - def user_service_verify_passkey_registration_with_http_info(user_id, passkey_id, user_service_verify_passkey_registration_request, opts = {}) + def verify_passkey_registration_with_http_info(user_service_verify_passkey_registration_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_verify_passkey_registration ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_passkey_registration ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_verify_passkey_registration" # MODIFIED - end - # verify the required parameter 'passkey_id' is set - if @api_client.config.client_side_validation && passkey_id.nil? - fail ArgumentError, "Missing the required parameter 'passkey_id' when calling Api::UserServiceApi.user_service_verify_passkey_registration" # MODIFIED - end # verify the required parameter 'user_service_verify_passkey_registration_request' is set if @api_client.config.client_side_validation && user_service_verify_passkey_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_passkey_registration_request' when calling Api::UserServiceApi.user_service_verify_passkey_registration" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_verify_passkey_registration_request' when calling Api::UserServiceApi.verify_passkey_registration" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/passkeys/{passkeyId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)).sub('{' + 'passkeyId' + '}', CGI.escape(passkey_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/VerifyPasskeyRegistration' # query parameters query_params = opts[:query_params] || {} @@ -2963,7 +2857,7 @@ def user_service_verify_passkey_registration_with_http_info(user_id, passkey_id, auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_verify_passkey_registration", # MODIFIED + :operation => :"Api::UserServiceApi.verify_passkey_registration", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2974,42 +2868,36 @@ def user_service_verify_passkey_registration_with_http_info(user_id, passkey_id, 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: Api::UserServiceApi#user_service_verify_passkey_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_passkey_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Verify the phone - # Verify the phone with the generated code.. - # @param user_id [String] + # VerifyPhone + # Verify the phone Verify the phone with the generated code.. # @param user_service_verify_phone_request [UserServiceVerifyPhoneRequest] # @param [Hash] opts the optional parameters # @return [UserServiceVerifyPhoneResponse] - def user_service_verify_phone(user_id, user_service_verify_phone_request, opts = {}) - data, _status_code, _headers = user_service_verify_phone_with_http_info(user_id, user_service_verify_phone_request, opts) + def verify_phone(user_service_verify_phone_request, opts = {}) + data, _status_code, _headers = verify_phone_with_http_info(user_service_verify_phone_request, opts) data end - # Verify the phone - # Verify the phone with the generated code.. - # @param user_id [String] + # VerifyPhone + # Verify the phone Verify the phone with the generated code.. # @param user_service_verify_phone_request [UserServiceVerifyPhoneRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceVerifyPhoneResponse, Integer, Hash)>] UserServiceVerifyPhoneResponse data, response status code and response headers - def user_service_verify_phone_with_http_info(user_id, user_service_verify_phone_request, opts = {}) + def verify_phone_with_http_info(user_service_verify_phone_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_verify_phone ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_phone ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_verify_phone" # MODIFIED - end # verify the required parameter 'user_service_verify_phone_request' is set if @api_client.config.client_side_validation && user_service_verify_phone_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_phone_request' when calling Api::UserServiceApi.user_service_verify_phone" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_verify_phone_request' when calling Api::UserServiceApi.verify_phone" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/phone/verify'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/VerifyPhone' # query parameters query_params = opts[:query_params] || {} @@ -3037,7 +2925,7 @@ def user_service_verify_phone_with_http_info(user_id, user_service_verify_phone_ auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_verify_phone", # MODIFIED + :operation => :"Api::UserServiceApi.verify_phone", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3048,42 +2936,36 @@ def user_service_verify_phone_with_http_info(user_id, user_service_verify_phone_ 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: Api::UserServiceApi#user_service_verify_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Verify a TOTP generator for a user - # Verify the TOTP registration with a generated code.. - # @param user_id [String] + # VerifyTOTPRegistration + # Verify a TOTP generator for a user Verify the TOTP registration with a generated code.. # @param user_service_verify_totp_registration_request [UserServiceVerifyTOTPRegistrationRequest] # @param [Hash] opts the optional parameters # @return [UserServiceVerifyTOTPRegistrationResponse] - def user_service_verify_totp_registration(user_id, user_service_verify_totp_registration_request, opts = {}) - data, _status_code, _headers = user_service_verify_totp_registration_with_http_info(user_id, user_service_verify_totp_registration_request, opts) + def verify_totp_registration(user_service_verify_totp_registration_request, opts = {}) + data, _status_code, _headers = verify_totp_registration_with_http_info(user_service_verify_totp_registration_request, opts) data end - # Verify a TOTP generator for a user - # Verify the TOTP registration with a generated code.. - # @param user_id [String] + # VerifyTOTPRegistration + # Verify a TOTP generator for a user Verify the TOTP registration with a generated code.. # @param user_service_verify_totp_registration_request [UserServiceVerifyTOTPRegistrationRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceVerifyTOTPRegistrationResponse, Integer, Hash)>] UserServiceVerifyTOTPRegistrationResponse data, response status code and response headers - def user_service_verify_totp_registration_with_http_info(user_id, user_service_verify_totp_registration_request, opts = {}) + def verify_totp_registration_with_http_info(user_service_verify_totp_registration_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_verify_totp_registration ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_totp_registration ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_verify_totp_registration" # MODIFIED - end # verify the required parameter 'user_service_verify_totp_registration_request' is set if @api_client.config.client_side_validation && user_service_verify_totp_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_totp_registration_request' when calling Api::UserServiceApi.user_service_verify_totp_registration" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_verify_totp_registration_request' when calling Api::UserServiceApi.verify_totp_registration" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/totp/verify'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/VerifyTOTPRegistration' # query parameters query_params = opts[:query_params] || {} @@ -3111,7 +2993,7 @@ def user_service_verify_totp_registration_with_http_info(user_id, user_service_v auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_verify_totp_registration", # MODIFIED + :operation => :"Api::UserServiceApi.verify_totp_registration", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3122,48 +3004,36 @@ def user_service_verify_totp_registration_with_http_info(user_id, user_service_v 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: Api::UserServiceApi#user_service_verify_totp_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_totp_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end - # Verify a u2f token for a user - # Verify the u2f token registration with the public key credential.. - # @param user_id [String] - # @param u2f_id [String] + # VerifyU2FRegistration + # Verify a u2f token for a user Verify the u2f token registration with the public key credential.. # @param user_service_verify_u2_f_registration_request [UserServiceVerifyU2FRegistrationRequest] # @param [Hash] opts the optional parameters # @return [UserServiceVerifyU2FRegistrationResponse] - def user_service_verify_u2_f_registration(user_id, u2f_id, user_service_verify_u2_f_registration_request, opts = {}) - data, _status_code, _headers = user_service_verify_u2_f_registration_with_http_info(user_id, u2f_id, user_service_verify_u2_f_registration_request, opts) + def verify_u2_f_registration(user_service_verify_u2_f_registration_request, opts = {}) + data, _status_code, _headers = verify_u2_f_registration_with_http_info(user_service_verify_u2_f_registration_request, opts) data end - # Verify a u2f token for a user - # Verify the u2f token registration with the public key credential.. - # @param user_id [String] - # @param u2f_id [String] + # VerifyU2FRegistration + # Verify a u2f token for a user Verify the u2f token registration with the public key credential.. # @param user_service_verify_u2_f_registration_request [UserServiceVerifyU2FRegistrationRequest] # @param [Hash] opts the optional parameters # @return [Array<(UserServiceVerifyU2FRegistrationResponse, Integer, Hash)>] UserServiceVerifyU2FRegistrationResponse data, response status code and response headers - def user_service_verify_u2_f_registration_with_http_info(user_id, u2f_id, user_service_verify_u2_f_registration_request, opts = {}) + def verify_u2_f_registration_with_http_info(user_service_verify_u2_f_registration_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.user_service_verify_u2_f_registration ...' # MODIFIED + @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_u2_f_registration ...' # MODIFIED end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling Api::UserServiceApi.user_service_verify_u2_f_registration" # MODIFIED - end - # verify the required parameter 'u2f_id' is set - if @api_client.config.client_side_validation && u2f_id.nil? - fail ArgumentError, "Missing the required parameter 'u2f_id' when calling Api::UserServiceApi.user_service_verify_u2_f_registration" # MODIFIED - end # verify the required parameter 'user_service_verify_u2_f_registration_request' is set if @api_client.config.client_side_validation && user_service_verify_u2_f_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_u2_f_registration_request' when calling Api::UserServiceApi.user_service_verify_u2_f_registration" # MODIFIED + fail ArgumentError, "Missing the required parameter 'user_service_verify_u2_f_registration_request' when calling Api::UserServiceApi.verify_u2_f_registration" # MODIFIED end # resource path - local_var_path = '/v2/users/{userId}/u2f/{u2fId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)).sub('{' + 'u2fId' + '}', CGI.escape(u2f_id.to_s)) + local_var_path = '/zitadel.user.v2.UserService/VerifyU2FRegistration' # query parameters query_params = opts[:query_params] || {} @@ -3191,7 +3061,7 @@ def user_service_verify_u2_f_registration_with_http_info(user_id, u2f_id, user_s auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] new_options = opts.merge( - :operation => :"Api::UserServiceApi.user_service_verify_u2_f_registration", # MODIFIED + :operation => :"Api::UserServiceApi.verify_u2_f_registration", # MODIFIED :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3202,7 +3072,7 @@ def user_service_verify_u2_f_registration_with_http_info(user_id, u2f_id, user_s 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: Api::UserServiceApi#user_service_verify_u2_f_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED + @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_u2_f_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED end return data, status_code, headers end diff --git a/lib/zitadel/client/api/web_key_service_api.rb b/lib/zitadel/client/api/web_key_service_api.rb deleted file mode 100644 index d915ea69..00000000 --- a/lib/zitadel/client/api/web_key_service_api.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class WebKeyServiceApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Activate Web Key - # Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` - # @param id [String] - # @param [Hash] opts the optional parameters - # @return [WebKeyServiceBetaActivateWebKeyResponse] - def web_key_service_activate_web_key(id, opts = {}) - data, _status_code, _headers = web_key_service_activate_web_key_with_http_info(id, opts) - data - end - - # Activate Web Key - # Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` - # @param id [String] - # @param [Hash] opts the optional parameters - # @return [Array<(WebKeyServiceBetaActivateWebKeyResponse, Integer, Hash)>] WebKeyServiceBetaActivateWebKeyResponse data, response status code and response headers - def web_key_service_activate_web_key_with_http_info(id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.web_key_service_activate_web_key ...' # MODIFIED - 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 Api::WebKeyServiceApi.web_key_service_activate_web_key" # MODIFIED - end - # resource path - local_var_path = '/v2beta/web_keys/{id}/activate'.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']) 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] || 'WebKeyServiceBetaActivateWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::WebKeyServiceApi.web_key_service_activate_web_key", # MODIFIED - :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: Api::WebKeyServiceApi#web_key_service_activate_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # Create Web Key - # Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` - # @param web_key_service_create_web_key_request [WebKeyServiceCreateWebKeyRequest] - # @param [Hash] opts the optional parameters - # @return [WebKeyServiceBetaCreateWebKeyResponse] - def web_key_service_create_web_key(web_key_service_create_web_key_request, opts = {}) - data, _status_code, _headers = web_key_service_create_web_key_with_http_info(web_key_service_create_web_key_request, opts) - data - end - - # Create Web Key - # Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` Required feature flag: - `web_key` - # @param web_key_service_create_web_key_request [WebKeyServiceCreateWebKeyRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WebKeyServiceBetaCreateWebKeyResponse, Integer, Hash)>] WebKeyServiceBetaCreateWebKeyResponse data, response status code and response headers - def web_key_service_create_web_key_with_http_info(web_key_service_create_web_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.web_key_service_create_web_key ...' # MODIFIED - end - # verify the required parameter 'web_key_service_create_web_key_request' is set - if @api_client.config.client_side_validation && web_key_service_create_web_key_request.nil? - fail ArgumentError, "Missing the required parameter 'web_key_service_create_web_key_request' when calling Api::WebKeyServiceApi.web_key_service_create_web_key" # MODIFIED - end - # resource path - local_var_path = '/v2beta/web_keys' - - # 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(web_key_service_create_web_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'WebKeyServiceBetaCreateWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::WebKeyServiceApi.web_key_service_create_web_key", # MODIFIED - :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: Api::WebKeyServiceApi#web_key_service_create_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # Delete Web Key - # Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` Required feature flag: - `web_key` - # @param id [String] - # @param [Hash] opts the optional parameters - # @return [WebKeyServiceBetaDeleteWebKeyResponse] - def web_key_service_delete_web_key(id, opts = {}) - data, _status_code, _headers = web_key_service_delete_web_key_with_http_info(id, opts) - data - end - - # Delete Web Key - # Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` Required feature flag: - `web_key` - # @param id [String] - # @param [Hash] opts the optional parameters - # @return [Array<(WebKeyServiceBetaDeleteWebKeyResponse, Integer, Hash)>] WebKeyServiceBetaDeleteWebKeyResponse data, response status code and response headers - def web_key_service_delete_web_key_with_http_info(id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.web_key_service_delete_web_key ...' # MODIFIED - 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 Api::WebKeyServiceApi.web_key_service_delete_web_key" # MODIFIED - end - # resource path - local_var_path = '/v2beta/web_keys/{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']) 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] || 'WebKeyServiceBetaDeleteWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::WebKeyServiceApi.web_key_service_delete_web_key", # MODIFIED - :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: Api::WebKeyServiceApi#web_key_service_delete_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - - # List Web Keys - # List all web keys and their states. Required permission: - `iam.web_key.read` Required feature flag: - `web_key` - # @param [Hash] opts the optional parameters - # @return [WebKeyServiceBetaListWebKeysResponse] - def web_key_service_list_web_keys(opts = {}) - data, _status_code, _headers = web_key_service_list_web_keys_with_http_info(opts) - data - end - - # List Web Keys - # List all web keys and their states. Required permission: - `iam.web_key.read` Required feature flag: - `web_key` - # @param [Hash] opts the optional parameters - # @return [Array<(WebKeyServiceBetaListWebKeysResponse, Integer, Hash)>] WebKeyServiceBetaListWebKeysResponse data, response status code and response headers - def web_key_service_list_web_keys_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.web_key_service_list_web_keys ...' # MODIFIED - end - # resource path - local_var_path = '/v2beta/web_keys' - - # 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] || 'WebKeyServiceBetaListWebKeysResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::WebKeyServiceApi.web_key_service_list_web_keys", # MODIFIED - :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: Api::WebKeyServiceApi#web_key_service_list_web_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data, status_code, headers - end - end -end diff --git a/lib/zitadel/client/models/action_service_beta_event_execution.rb b/lib/zitadel/client/models/action_service_beta_event_execution.rb deleted file mode 100644 index b199abc7..00000000 --- a/lib/zitadel/client/models/action_service_beta_event_execution.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ActionServiceBetaEventExecution - # Event name as condition. - attr_accessor :event - - # Event group as condition, all events under this group. - attr_accessor :group - - # all events as condition. - attr_accessor :all - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event' => :'event', - :'group' => :'group', - :'all' => :'all' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'event' => :'String', - :'group' => :'String', - :'all' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaEventExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaEventExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event') - self.event = attributes[:'event'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - - if attributes.key?(:'all') - self.all = attributes[:'all'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@event.nil? && @event.to_s.length > 1000 - invalid_properties.push('invalid value for "event", the character length must be smaller than or equal to 1000.') - end - - if !@event.nil? && @event.to_s.length < 1 - invalid_properties.push('invalid value for "event", the character length must be great than or equal to 1.') - end - - if !@group.nil? && @group.to_s.length > 1000 - invalid_properties.push('invalid value for "group", the character length must be smaller than or equal to 1000.') - end - - if !@group.nil? && @group.to_s.length < 1 - invalid_properties.push('invalid value for "group", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@event.nil? && @event.to_s.length > 1000 - return false if !@event.nil? && @event.to_s.length < 1 - return false if !@group.nil? && @group.to_s.length > 1000 - return false if !@group.nil? && @group.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] event Value to be assigned - def event=(event) - if event.nil? - fail ArgumentError, 'event cannot be nil' - end - - if event.to_s.length > 1000 - fail ArgumentError, 'invalid value for "event", the character length must be smaller than or equal to 1000.' - end - - if event.to_s.length < 1 - fail ArgumentError, 'invalid value for "event", the character length must be great than or equal to 1.' - end - - @event = event - end - - # Custom attribute writer method with validation - # @param [Object] group Value to be assigned - def group=(group) - if group.nil? - fail ArgumentError, 'group cannot be nil' - end - - if group.to_s.length > 1000 - fail ArgumentError, 'invalid value for "group", the character length must be smaller than or equal to 1000.' - end - - if group.to_s.length < 1 - fail ArgumentError, 'invalid value for "group", the character length must be great than or equal to 1.' - end - - @group = group - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event == o.event && - group == o.group && - all == o.all - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event, group, all].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/action_service_beta_text_filter_method.rb b/lib/zitadel/client/models/action_service_beta_text_filter_method.rb deleted file mode 100644 index e4dfe39c..00000000 --- a/lib/zitadel/client/models/action_service_beta_text_filter_method.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ActionServiceBetaTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ActionServiceBetaTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServiceBetaTextFilterMethod" - end - end - -end diff --git a/lib/zitadel/client/models/action_service_update_target_request.rb b/lib/zitadel/client/models/action_service_update_target_request.rb deleted file mode 100644 index efec5a09..00000000 --- a/lib/zitadel/client/models/action_service_update_target_request.rb +++ /dev/null @@ -1,342 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ActionServiceUpdateTargetRequest - attr_accessor :name - - attr_accessor :rest_webhook - - attr_accessor :rest_call - - attr_accessor :rest_async - - # Timeout defines the duration until ZITADEL cancels the execution. If the target doesn't respond before this timeout expires, then the connection is closed and the action fails. Depending on the target type and possible setting on `interrupt_on_error` following targets will not be called. In case of a `rest_async` target only this specific target will fail, without any influence on other targets of the same execution. - attr_accessor :timeout - - attr_accessor :endpoint - - # Regenerate the key used for signing and checking the payload sent to the target. Set the graceful period for the existing key. During that time, the previous signing key and the new one will be used to sign the request to allow you a smooth transition onf your API. Note that we currently only allow an immediate rotation (\"0s\") and will support longer expirations in the future. - attr_accessor :expiration_signing_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'rest_webhook' => :'restWebhook', - :'rest_call' => :'restCall', - :'rest_async' => :'restAsync', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint', - :'expiration_signing_key' => :'expirationSigningKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'rest_webhook' => :'ActionServiceBetaRESTWebhook', - :'rest_call' => :'ActionServiceBetaRESTCall', - :'rest_async' => :'Object', - :'timeout' => :'String', - :'endpoint' => :'String', - :'expiration_signing_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceUpdateTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceUpdateTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] - end - - if attributes.key?(:'expiration_signing_key') - self.expiration_signing_key = attributes[:'expiration_signing_key'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@name.nil? && @name.to_s.length > 1000 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 1000.') - end - - if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - - if !@endpoint.nil? && @endpoint.to_s.length > 1000 - invalid_properties.push('invalid value for "endpoint", the character length must be smaller than or equal to 1000.') - end - - if !@endpoint.nil? && @endpoint.to_s.length < 1 - invalid_properties.push('invalid value for "endpoint", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@name.nil? && @name.to_s.length > 1000 - return false if !@name.nil? && @name.to_s.length < 1 - return false if !@endpoint.nil? && @endpoint.to_s.length > 1000 - return false if !@endpoint.nil? && @endpoint.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length > 1000 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 1000.' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - @name = name - end - - # Custom attribute writer method with validation - # @param [Object] endpoint Value to be assigned - def endpoint=(endpoint) - if endpoint.nil? - fail ArgumentError, 'endpoint cannot be nil' - end - - if endpoint.to_s.length > 1000 - fail ArgumentError, 'invalid value for "endpoint", the character length must be smaller than or equal to 1000.' - end - - if endpoint.to_s.length < 1 - fail ArgumentError, 'invalid value for "endpoint", the character length must be great than or equal to 1.' - end - - @endpoint = endpoint - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - rest_webhook == o.rest_webhook && - rest_call == o.rest_call && - rest_async == o.rest_async && - timeout == o.timeout && - endpoint == o.endpoint && - expiration_signing_key == o.expiration_signing_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, rest_webhook, rest_call, rest_async, timeout, endpoint, expiration_signing_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/and_query.rb b/lib/zitadel/client/models/and_query.rb new file mode 100644 index 00000000..50e92781 --- /dev/null +++ b/lib/zitadel/client/models/and_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class AndQuery + attr_accessor :and_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'and_query' => :'andQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'and_query' => :'UserServiceAndQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AndQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AndQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'and_query') + self.and_query = attributes[:'and_query'] + else + self.and_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @and_query.nil? + invalid_properties.push('invalid value for "and_query", and_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @and_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceAndQuery] and_query Value to be assigned + def and_query=(and_query) + if and_query.nil? + fail ArgumentError, 'and_query cannot be nil' + end + + @and_query = and_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + and_query == o.and_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [and_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/and_query1.rb b/lib/zitadel/client/models/and_query1.rb new file mode 100644 index 00000000..dd55141f --- /dev/null +++ b/lib/zitadel/client/models/and_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class AndQuery1 + attr_accessor :and_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'and_query' => :'andQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'and_query' => :'BetaUserServiceAndQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AndQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AndQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'and_query') + self.and_query = attributes[:'and_query'] + else + self.and_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @and_query.nil? + invalid_properties.push('invalid value for "and_query", and_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @and_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceAndQuery] and_query Value to be assigned + def and_query=(and_query) + if and_query.nil? + fail ArgumentError, 'and_query cannot be nil' + end + + @and_query = and_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + and_query == o.and_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [and_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/apple.rb b/lib/zitadel/client/models/apple.rb new file mode 100644 index 00000000..a3372329 --- /dev/null +++ b/lib/zitadel/client/models/apple.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Apple + attr_accessor :apple + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'apple' => :'apple' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'apple' => :'IdentityProviderServiceAppleConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Apple` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Apple`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'apple') + self.apple = attributes[:'apple'] + else + self.apple = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @apple.nil? + invalid_properties.push('invalid value for "apple", apple cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @apple.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceAppleConfig] apple Value to be assigned + def apple=(apple) + if apple.nil? + fail ArgumentError, 'apple cannot be nil' + end + + @apple = apple + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + apple == o.apple + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [apple].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/auth_url.rb b/lib/zitadel/client/models/auth_url.rb new file mode 100644 index 00000000..be486566 --- /dev/null +++ b/lib/zitadel/client/models/auth_url.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class AuthUrl + attr_accessor :auth_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'auth_url' => :'authUrl' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'auth_url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthUrl` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthUrl`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'auth_url') + self.auth_url = attributes[:'auth_url'] + else + self.auth_url = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @auth_url.nil? + invalid_properties.push('invalid value for "auth_url", auth_url cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @auth_url.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] auth_url Value to be assigned + def auth_url=(auth_url) + if auth_url.nil? + fail ArgumentError, 'auth_url cannot be nil' + end + + @auth_url = auth_url + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth_url == o.auth_url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [auth_url].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/azure_ad.rb b/lib/zitadel/client/models/azure_ad.rb new file mode 100644 index 00000000..736d5976 --- /dev/null +++ b/lib/zitadel/client/models/azure_ad.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class AzureAd + attr_accessor :azure_ad + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'azure_ad' => :'azureAd' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'azure_ad' => :'IdentityProviderServiceAzureADConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AzureAd` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AzureAd`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'azure_ad') + self.azure_ad = attributes[:'azure_ad'] + else + self.azure_ad = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @azure_ad.nil? + invalid_properties.push('invalid value for "azure_ad", azure_ad cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @azure_ad.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceAzureADConfig] azure_ad Value to be assigned + def azure_ad=(azure_ad) + if azure_ad.nil? + fail ArgumentError, 'azure_ad cannot be nil' + end + + @azure_ad = azure_ad + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + azure_ad == o.azure_ad + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [azure_ad].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/o_i_d_c_service_rpc_status.rb b/lib/zitadel/client/models/beta_action_service_any.rb similarity index 88% rename from lib/zitadel/client/models/o_i_d_c_service_rpc_status.rb rename to lib/zitadel/client/models/beta_action_service_any.rb index 11451a0f..5b07ce15 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_rpc_status.rb +++ b/lib/zitadel/client/models/beta_action_service_any.rb @@ -14,19 +14,20 @@ require 'time' module Zitadel::Client::Models - class OIDCServiceRpcStatus - attr_accessor :code + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class BetaActionServiceAny + attr_accessor :type - attr_accessor :message + attr_accessor :value - attr_accessor :details + attr_accessor :debug # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' } end @@ -43,9 +44,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' } end @@ -60,7 +61,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceAny` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,22 +69,22 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] + if attributes.key?(:'type') + self.type = attributes[:'type'] end - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'value') + self.value = attributes[:'value'] end - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value end end end @@ -108,9 +109,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + type == o.type && + value == o.value && + debug == o.debug end # @see the `==` method @@ -122,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [type, value, debug].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_action_service_condition.rb b/lib/zitadel/client/models/beta_action_service_condition.rb new file mode 100644 index 00000000..6f0807d2 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_condition.rb @@ -0,0 +1,112 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaActionServiceCondition + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Event', + :'Function', + :'Request', + :'Response' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_action_service_connect_error.rb b/lib/zitadel/client/models/beta_action_service_connect_error.rb new file mode 100644 index 00000000..681c0e99 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaActionServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'BetaActionServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_action_service_create_target_request.rb b/lib/zitadel/client/models/beta_action_service_create_target_request.rb new file mode 100644 index 00000000..6ed19e34 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_create_target_request.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaActionServiceCreateTargetRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'RestAsync', + :'RestCall', + :'RestWebhook' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/action_service_beta_target.rb b/lib/zitadel/client/models/beta_action_service_create_target_response.rb similarity index 63% rename from lib/zitadel/client/models/action_service_beta_target.rb rename to lib/zitadel/client/models/beta_action_service_create_target_response.rb index 03d8a74a..4abbe999 100644 --- a/lib/zitadel/client/models/action_service_beta_target.rb +++ b/lib/zitadel/client/models/beta_action_service_create_target_response.rb @@ -14,29 +14,14 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaTarget - # The unique identifier of the target. + class BetaActionServiceCreateTargetResponse + # The unique identifier of the newly created target. attr_accessor :id - # The timestamp of the target creation. + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date - # The timestamp of the last change to the target (e.g. creation, activation, deactivation). - attr_accessor :change_date - - attr_accessor :name - - attr_accessor :rest_webhook - - attr_accessor :rest_call - - attr_accessor :rest_async - - # Timeout defines the duration until ZITADEL cancels the execution. If the target doesn't respond before this timeout expires, the the connection is closed and the action fails. Depending on the target type and possible setting on `interrupt_on_error` following targets will not be called. In case of a `rest_async` target only this specific target will fail, without any influence on other targets of the same execution. - attr_accessor :timeout - - attr_accessor :endpoint - + # Key used to sign and check payload sent to the target. attr_accessor :signing_key # Attribute mapping from ruby-style variable name to JSON key. @@ -44,13 +29,6 @@ def self.attribute_map { :'id' => :'id', :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'name' => :'name', - :'rest_webhook' => :'restWebhook', - :'rest_call' => :'restCall', - :'rest_async' => :'restAsync', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint', :'signing_key' => :'signingKey' } end @@ -70,13 +48,6 @@ def self.openapi_types { :'id' => :'String', :'creation_date' => :'Time', - :'change_date' => :'Time', - :'name' => :'String', - :'rest_webhook' => :'ActionServiceBetaRESTWebhook', - :'rest_call' => :'ActionServiceBetaRESTCall', - :'rest_async' => :'Object', - :'timeout' => :'String', - :'endpoint' => :'String', :'signing_key' => :'String' } end @@ -92,7 +63,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaTarget` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceCreateTargetResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -100,7 +71,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaTarget`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceCreateTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -113,34 +84,6 @@ def initialize(attributes = {}) self.creation_date = attributes[:'creation_date'] end - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] - end - if attributes.key?(:'signing_key') self.signing_key = attributes[:'signing_key'] end @@ -168,13 +111,6 @@ def ==(o) self.class == o.class && id == o.id && creation_date == o.creation_date && - change_date == o.change_date && - name == o.name && - rest_webhook == o.rest_webhook && - rest_call == o.rest_call && - rest_async == o.rest_async && - timeout == o.timeout && - endpoint == o.endpoint && signing_key == o.signing_key end @@ -187,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, creation_date, change_date, name, rest_webhook, rest_call, rest_async, timeout, endpoint, signing_key].hash + [id, creation_date, signing_key].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/session_service_creator_query.rb b/lib/zitadel/client/models/beta_action_service_delete_target_request.rb similarity index 89% rename from lib/zitadel/client/models/session_service_creator_query.rb rename to lib/zitadel/client/models/beta_action_service_delete_target_request.rb index 51185823..e979b0f6 100644 --- a/lib/zitadel/client/models/session_service_creator_query.rb +++ b/lib/zitadel/client/models/beta_action_service_delete_target_request.rb @@ -14,8 +14,7 @@ require 'time' module Zitadel::Client::Models - class SessionServiceCreatorQuery - # ID of the user who created the session. If empty, the calling user's ID is used. + class BetaActionServiceDeleteTargetRequest attr_accessor :id # Attribute mapping from ruby-style variable name to JSON key. @@ -53,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCreatorQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceDeleteTargetRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCreatorQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceDeleteTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end end @@ -76,8 +77,8 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@id.nil? && @id.to_s.length > 200 - invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 200.') + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') end invalid_properties @@ -87,21 +88,17 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@id.nil? && @id.to_s.length > 200 + return false if @id.nil? true end # Custom attribute writer method with validation - # @param [Object] id Value to be assigned + # @param [String] id Value to be assigned def id=(id) if id.nil? fail ArgumentError, 'id cannot be nil' end - if id.to_s.length > 200 - fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 200.' - end - @id = id end diff --git a/lib/zitadel/client/models/action_service_beta_delete_target_response.rb b/lib/zitadel/client/models/beta_action_service_delete_target_response.rb similarity index 64% rename from lib/zitadel/client/models/action_service_beta_delete_target_response.rb rename to lib/zitadel/client/models/beta_action_service_delete_target_response.rb index d86214ef..80e25fd9 100644 --- a/lib/zitadel/client/models/action_service_beta_delete_target_response.rb +++ b/lib/zitadel/client/models/beta_action_service_delete_target_response.rb @@ -14,8 +14,8 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaDeleteTargetResponse - # The timestamp of the deletion of the target. Note that the deletion date is only guaranteed to be set if the deletion was successful during the request. In case the deletion occurred in a previous request, the deletion date might be empty. + class BetaActionServiceDeleteTargetResponse + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :deletion_date # Attribute mapping from ruby-style variable name to JSON key. @@ -53,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaDeleteTargetResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceDeleteTargetResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,7 +61,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaDeleteTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceDeleteTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/beta_action_service_execution.rb b/lib/zitadel/client/models/beta_action_service_execution.rb new file mode 100644 index 00000000..a99851d9 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_execution.rb @@ -0,0 +1,262 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaActionServiceExecution + attr_accessor :condition + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + # Ordered list of targets called during the execution. + attr_accessor :targets + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'condition' => :'condition', + :'creation_date' => :'creationDate', + :'change_date' => :'changeDate', + :'targets' => :'targets' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'condition' => :'BetaActionServiceCondition', + :'creation_date' => :'Time', + :'change_date' => :'Time', + :'targets' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceExecution` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'condition') + self.condition = attributes[:'condition'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'targets') + if (value = attributes[:'targets']).is_a?(Array) + self.targets = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + condition == o.condition && + creation_date == o.creation_date && + change_date == o.change_date && + targets == o.targets + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [condition, creation_date, change_date, targets].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_action_service_execution_field_name.rb b/lib/zitadel/client/models/beta_action_service_execution_field_name.rb new file mode 100644 index 00000000..d1101b8e --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_execution_field_name.rb @@ -0,0 +1,43 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaActionServiceExecutionFieldName + EXECUTION_FIELD_NAME_UNSPECIFIED = "EXECUTION_FIELD_NAME_UNSPECIFIED".freeze + EXECUTION_FIELD_NAME_ID = "EXECUTION_FIELD_NAME_ID".freeze + EXECUTION_FIELD_NAME_CREATED_DATE = "EXECUTION_FIELD_NAME_CREATED_DATE".freeze + EXECUTION_FIELD_NAME_CHANGED_DATE = "EXECUTION_FIELD_NAME_CHANGED_DATE".freeze + + def self.all_vars + @all_vars ||= [EXECUTION_FIELD_NAME_UNSPECIFIED, EXECUTION_FIELD_NAME_ID, EXECUTION_FIELD_NAME_CREATED_DATE, EXECUTION_FIELD_NAME_CHANGED_DATE].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaActionServiceExecutionFieldName.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaActionServiceExecutionFieldName" + end + end + +end diff --git a/lib/zitadel/client/models/beta_action_service_execution_search_filter.rb b/lib/zitadel/client/models/beta_action_service_execution_search_filter.rb new file mode 100644 index 00000000..be88689b --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_execution_search_filter.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaActionServiceExecutionSearchFilter + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ExecutionTypeFilter', + :'InConditionsFilter', + :'TargetFilter' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/session_service_user_i_d_query.rb b/lib/zitadel/client/models/beta_action_service_get_target_request.rb similarity index 95% rename from lib/zitadel/client/models/session_service_user_i_d_query.rb rename to lib/zitadel/client/models/beta_action_service_get_target_request.rb index bdcdad12..f04e14d3 100644 --- a/lib/zitadel/client/models/session_service_user_i_d_query.rb +++ b/lib/zitadel/client/models/beta_action_service_get_target_request.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class SessionServiceUserIDQuery + class BetaActionServiceGetTargetRequest attr_accessor :id # Attribute mapping from ruby-style variable name to JSON key. @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceUserIDQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceGetTargetRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +60,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceUserIDQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceGetTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/action_service_beta_get_target_response.rb b/lib/zitadel/client/models/beta_action_service_get_target_response.rb similarity index 96% rename from lib/zitadel/client/models/action_service_beta_get_target_response.rb rename to lib/zitadel/client/models/beta_action_service_get_target_response.rb index 5e3227a9..37ff50d7 100644 --- a/lib/zitadel/client/models/action_service_beta_get_target_response.rb +++ b/lib/zitadel/client/models/beta_action_service_get_target_response.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaGetTargetResponse + class BetaActionServiceGetTargetResponse attr_accessor :target # Attribute mapping from ruby-style variable name to JSON key. @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'target' => :'ActionServiceBetaTarget' + :'target' => :'BetaActionServiceTarget' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaGetTargetResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceGetTargetResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +60,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaGetTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceGetTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/action_service_beta_list_execution_functions_response.rb b/lib/zitadel/client/models/beta_action_service_list_execution_functions_response.rb similarity index 97% rename from lib/zitadel/client/models/action_service_beta_list_execution_functions_response.rb rename to lib/zitadel/client/models/beta_action_service_list_execution_functions_response.rb index 469086e5..d1414296 100644 --- a/lib/zitadel/client/models/action_service_beta_list_execution_functions_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_execution_functions_response.rb @@ -14,7 +14,8 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaListExecutionFunctionsResponse + class BetaActionServiceListExecutionFunctionsResponse + # All available methods attr_accessor :functions # Attribute mapping from ruby-style variable name to JSON key. @@ -52,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaListExecutionFunctionsResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionFunctionsResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +61,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaListExecutionFunctionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionFunctionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/action_service_beta_list_execution_methods_response.rb b/lib/zitadel/client/models/beta_action_service_list_execution_methods_response.rb similarity index 97% rename from lib/zitadel/client/models/action_service_beta_list_execution_methods_response.rb rename to lib/zitadel/client/models/beta_action_service_list_execution_methods_response.rb index 3e6fb174..46319299 100644 --- a/lib/zitadel/client/models/action_service_beta_list_execution_methods_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_execution_methods_response.rb @@ -14,7 +14,8 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaListExecutionMethodsResponse + class BetaActionServiceListExecutionMethodsResponse + # All available methods attr_accessor :methods # Attribute mapping from ruby-style variable name to JSON key. @@ -52,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaListExecutionMethodsResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionMethodsResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +61,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaListExecutionMethodsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionMethodsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/action_service_beta_list_execution_services_response.rb b/lib/zitadel/client/models/beta_action_service_list_execution_services_response.rb similarity index 97% rename from lib/zitadel/client/models/action_service_beta_list_execution_services_response.rb rename to lib/zitadel/client/models/beta_action_service_list_execution_services_response.rb index a00b995a..00e320ea 100644 --- a/lib/zitadel/client/models/action_service_beta_list_execution_services_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_execution_services_response.rb @@ -14,7 +14,8 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaListExecutionServicesResponse + class BetaActionServiceListExecutionServicesResponse + # All available methods attr_accessor :services # Attribute mapping from ruby-style variable name to JSON key. @@ -52,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaListExecutionServicesResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionServicesResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +61,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaListExecutionServicesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionServicesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/beta_action_service_list_executions_request.rb b/lib/zitadel/client/models/beta_action_service_list_executions_request.rb new file mode 100644 index 00000000..66ce9282 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_list_executions_request.rb @@ -0,0 +1,273 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaActionServiceListExecutionsRequest + attr_accessor :pagination + + attr_accessor :sorting_column + + # Define the criteria to query for. + attr_accessor :filters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'sorting_column' => :'sortingColumn', + :'filters' => :'filters' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'BetaActionServicePaginationRequest', + :'sorting_column' => :'BetaActionServiceExecutionFieldName', + :'filters' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'sorting_column') + self.sorting_column = attributes[:'sorting_column'] + end + + if attributes.key?(:'filters') + if (value = attributes[:'filters']).is_a?(Array) + self.filters = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + sorting_column == o.sorting_column && + filters == o.filters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, sorting_column, filters].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_list_executions_response.rb b/lib/zitadel/client/models/beta_action_service_list_executions_response.rb similarity index 96% rename from lib/zitadel/client/models/action_service_beta_list_executions_response.rb rename to lib/zitadel/client/models/beta_action_service_list_executions_response.rb index b8972fa2..22544eef 100644 --- a/lib/zitadel/client/models/action_service_beta_list_executions_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_executions_response.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaListExecutionsResponse + class BetaActionServiceListExecutionsResponse attr_accessor :pagination attr_accessor :result @@ -40,8 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'pagination' => :'ActionServiceBetaPaginationResponse', - :'result' => :'Array' + :'pagination' => :'BetaActionServicePaginationResponse', + :'result' => :'Array' } end @@ -56,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaListExecutionsResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionsResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,7 +64,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaListExecutionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/action_service_list_targets_request.rb b/lib/zitadel/client/models/beta_action_service_list_targets_request.rb similarity index 93% rename from lib/zitadel/client/models/action_service_list_targets_request.rb rename to lib/zitadel/client/models/beta_action_service_list_targets_request.rb index bfd900d3..0a86e8eb 100644 --- a/lib/zitadel/client/models/action_service_list_targets_request.rb +++ b/lib/zitadel/client/models/beta_action_service_list_targets_request.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class ActionServiceListTargetsRequest + class BetaActionServiceListTargetsRequest attr_accessor :pagination attr_accessor :sorting_column @@ -66,9 +66,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'pagination' => :'ActionServiceBetaPaginationRequest', - :'sorting_column' => :'ActionServiceBetaTargetFieldName', - :'filters' => :'Array' + :'pagination' => :'BetaActionServicePaginationRequest', + :'sorting_column' => :'BetaActionServiceTargetFieldName', + :'filters' => :'Array' } end @@ -83,7 +83,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListTargetsRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListTargetsRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -91,7 +91,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListTargetsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListTargetsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -102,8 +102,6 @@ def initialize(attributes = {}) if attributes.key?(:'sorting_column') self.sorting_column = attributes[:'sorting_column'] - else - self.sorting_column = 'TARGET_FIELD_NAME_UNSPECIFIED' end if attributes.key?(:'filters') diff --git a/lib/zitadel/client/models/action_service_beta_list_targets_response.rb b/lib/zitadel/client/models/beta_action_service_list_targets_response.rb similarity index 96% rename from lib/zitadel/client/models/action_service_beta_list_targets_response.rb rename to lib/zitadel/client/models/beta_action_service_list_targets_response.rb index 980c2bc0..763310d7 100644 --- a/lib/zitadel/client/models/action_service_beta_list_targets_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_targets_response.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaListTargetsResponse + class BetaActionServiceListTargetsResponse attr_accessor :pagination attr_accessor :result @@ -40,8 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'pagination' => :'ActionServiceBetaPaginationResponse', - :'result' => :'Array' + :'pagination' => :'BetaActionServicePaginationResponse', + :'result' => :'Array' } end @@ -56,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaListTargetsResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListTargetsResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,7 +64,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaListTargetsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListTargetsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/action_service_beta_pagination_request.rb b/lib/zitadel/client/models/beta_action_service_pagination_request.rb similarity index 94% rename from lib/zitadel/client/models/action_service_beta_pagination_request.rb rename to lib/zitadel/client/models/beta_action_service_pagination_request.rb index c0c7142e..0c440d12 100644 --- a/lib/zitadel/client/models/action_service_beta_pagination_request.rb +++ b/lib/zitadel/client/models/beta_action_service_pagination_request.rb @@ -14,14 +14,14 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaPaginationRequest + class BetaActionServicePaginationRequest # Starting point for retrieval, in combination of offset used to query a set list of objects. attr_accessor :offset - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. attr_accessor :limit - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. attr_accessor :asc # Attribute mapping from ruby-style variable name to JSON key. @@ -46,7 +46,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'offset' => :'String', + :'offset' => :'Object', :'limit' => :'Integer', :'asc' => :'Boolean' } @@ -55,6 +55,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'offset', ]) end @@ -63,7 +64,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaPaginationRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServicePaginationRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -71,7 +72,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaPaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/action_service_beta_pagination_response.rb b/lib/zitadel/client/models/beta_action_service_pagination_response.rb similarity index 96% rename from lib/zitadel/client/models/action_service_beta_pagination_response.rb rename to lib/zitadel/client/models/beta_action_service_pagination_response.rb index 1cbd0f72..6c267e1c 100644 --- a/lib/zitadel/client/models/action_service_beta_pagination_response.rb +++ b/lib/zitadel/client/models/beta_action_service_pagination_response.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaPaginationResponse + class BetaActionServicePaginationResponse # Absolute number of objects matching the query, regardless of applied limit. attr_accessor :total_result @@ -42,14 +42,16 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'total_result' => :'String', - :'applied_limit' => :'String' + :'total_result' => :'Object', + :'applied_limit' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'total_result', + :'applied_limit' ]) end @@ -58,7 +60,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaPaginationResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServicePaginationResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,7 +68,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaPaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/action_service_set_execution_request.rb b/lib/zitadel/client/models/beta_action_service_set_execution_request.rb similarity index 95% rename from lib/zitadel/client/models/action_service_set_execution_request.rb rename to lib/zitadel/client/models/beta_action_service_set_execution_request.rb index 7d51e6c2..4a94ba6d 100644 --- a/lib/zitadel/client/models/action_service_set_execution_request.rb +++ b/lib/zitadel/client/models/beta_action_service_set_execution_request.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class ActionServiceSetExecutionRequest + class BetaActionServiceSetExecutionRequest attr_accessor :condition # Ordered list of targets called during the execution. @@ -41,7 +41,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'condition' => :'ActionServiceBetaCondition', + :'condition' => :'BetaActionServiceCondition', :'targets' => :'Array' } end @@ -57,7 +57,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceSetExecutionRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceSetExecutionRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -65,7 +65,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceSetExecutionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceSetExecutionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/beta_action_service_set_execution_response.rb b/lib/zitadel/client/models/beta_action_service_set_execution_response.rb new file mode 100644 index 00000000..ade7f8cf --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_set_execution_response.rb @@ -0,0 +1,231 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaActionServiceSetExecutionResponse + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :set_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'set_date' => :'setDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'set_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceSetExecutionResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceSetExecutionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'set_date') + self.set_date = attributes[:'set_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + set_date == o.set_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [set_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_action_service_target.rb b/lib/zitadel/client/models/beta_action_service_target.rb new file mode 100644 index 00000000..d6e7d0a3 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_target.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaActionServiceTarget + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'RestAsync', + :'RestCall', + :'RestWebhook' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/action_service_beta_target_field_name.rb b/lib/zitadel/client/models/beta_action_service_target_field_name.rb similarity index 92% rename from lib/zitadel/client/models/action_service_beta_target_field_name.rb rename to lib/zitadel/client/models/beta_action_service_target_field_name.rb index e2a98ce4..bcdadd21 100644 --- a/lib/zitadel/client/models/action_service_beta_target_field_name.rb +++ b/lib/zitadel/client/models/beta_action_service_target_field_name.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaTargetFieldName + class BetaActionServiceTargetFieldName TARGET_FIELD_NAME_UNSPECIFIED = "TARGET_FIELD_NAME_UNSPECIFIED".freeze TARGET_FIELD_NAME_ID = "TARGET_FIELD_NAME_ID".freeze TARGET_FIELD_NAME_CREATED_DATE = "TARGET_FIELD_NAME_CREATED_DATE".freeze @@ -40,8 +40,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if ActionServiceBetaTargetFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServiceBetaTargetFieldName" + return value if BetaActionServiceTargetFieldName.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaActionServiceTargetFieldName" end end diff --git a/lib/zitadel/client/models/beta_action_service_target_search_filter.rb b/lib/zitadel/client/models/beta_action_service_target_search_filter.rb new file mode 100644 index 00000000..d0ae74d9 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_target_search_filter.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaActionServiceTargetSearchFilter + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'InTargetIdsFilter', + :'TargetNameFilter' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_action_service_update_target_request.rb b/lib/zitadel/client/models/beta_action_service_update_target_request.rb new file mode 100644 index 00000000..9f892fd4 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_update_target_request.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaActionServiceUpdateTargetRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'RestAsync', + :'RestCall', + :'RestWebhook' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_action_service_update_target_response.rb b/lib/zitadel/client/models/beta_action_service_update_target_response.rb new file mode 100644 index 00000000..cc67d5ba --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_update_target_response.rb @@ -0,0 +1,242 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaActionServiceUpdateTargetResponse + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + # Key used to sign and check payload sent to the target. + attr_accessor :signing_key + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'change_date' => :'changeDate', + :'signing_key' => :'signingKey' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'change_date' => :'Time', + :'signing_key' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'signing_key' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceUpdateTargetResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceUpdateTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'signing_key') + self.signing_key = attributes[:'signing_key'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + change_date == o.change_date && + signing_key == o.signing_key + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [change_date, signing_key].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_any.rb b/lib/zitadel/client/models/beta_feature_service_any.rb new file mode 100644 index 00000000..ffe32828 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class BetaFeatureServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_connect_error.rb b/lib/zitadel/client/models/beta_feature_service_connect_error.rb new file mode 100644 index 00000000..19e32525 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaFeatureServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'BetaFeatureServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_details.rb b/lib/zitadel/client/models/beta_feature_service_details.rb new file mode 100644 index 00000000..b1426585 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_details.rb @@ -0,0 +1,262 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceDetails + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + attr_accessor :sequence + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + # resource_owner is the organization or instance_id an object belongs to + attr_accessor :resource_owner + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'sequence' => :'sequence', + :'change_date' => :'changeDate', + :'resource_owner' => :'resourceOwner', + :'creation_date' => :'creationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'sequence' => :'Object', + :'change_date' => :'Time', + :'resource_owner' => :'String', + :'creation_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'sequence', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'sequence') + self.sequence = attributes[:'sequence'] + end + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'resource_owner') + self.resource_owner = attributes[:'resource_owner'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sequence == o.sequence && + change_date == o.change_date && + resource_owner == o.resource_owner && + creation_date == o.creation_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [sequence, change_date, resource_owner, creation_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/s_a_m_l_service_authorization_error.rb b/lib/zitadel/client/models/beta_feature_service_feature_flag.rb similarity index 90% rename from lib/zitadel/client/models/s_a_m_l_service_authorization_error.rb rename to lib/zitadel/client/models/beta_feature_service_feature_flag.rb index 53e24906..35376797 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_authorization_error.rb +++ b/lib/zitadel/client/models/beta_feature_service_feature_flag.rb @@ -14,10 +14,11 @@ require 'time' module Zitadel::Client::Models - class SAMLServiceAuthorizationError - attr_accessor :error + # FeatureFlag is a simple boolean Feature setting, without further payload. + class BetaFeatureServiceFeatureFlag + attr_accessor :enabled - attr_accessor :error_description + attr_accessor :source class EnumAttributeValidator attr_reader :datatype @@ -44,8 +45,8 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'error' => :'error', - :'error_description' => :'errorDescription' + :'enabled' => :'enabled', + :'source' => :'source' } end @@ -62,8 +63,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'error' => :'SAMLServiceErrorReason', - :'error_description' => :'String' + :'enabled' => :'Boolean', + :'source' => :'BetaFeatureServiceSource' } end @@ -78,7 +79,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceAuthorizationError` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceFeatureFlag` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -86,19 +87,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceAuthorizationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceFeatureFlag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'error') - self.error = attributes[:'error'] - else - self.error = 'ERROR_REASON_UNSPECIFIED' + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] end - if attributes.key?(:'error_description') - self.error_description = attributes[:'error_description'] + if attributes.key?(:'source') + self.source = attributes[:'source'] end end @@ -122,8 +121,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - error == o.error && - error_description == o.error_description + enabled == o.enabled && + source == o.source end # @see the `==` method @@ -135,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [error, error_description].hash + [enabled, source].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_feature_service_get_instance_features_request.rb b/lib/zitadel/client/models/beta_feature_service_get_instance_features_request.rb new file mode 100644 index 00000000..773a30dc --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_get_instance_features_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceGetInstanceFeaturesRequest + attr_accessor :inheritance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'inheritance' => :'inheritance' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'inheritance' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetInstanceFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetInstanceFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'inheritance') + self.inheritance = attributes[:'inheritance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + inheritance == o.inheritance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [inheritance].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_request_execution.rb b/lib/zitadel/client/models/beta_feature_service_get_instance_features_response.rb similarity index 62% rename from lib/zitadel/client/models/action_service_beta_request_execution.rb rename to lib/zitadel/client/models/beta_feature_service_get_instance_features_response.rb index 6ad3094d..9e18f993 100644 --- a/lib/zitadel/client/models/action_service_beta_request_execution.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_instance_features_response.rb @@ -14,22 +14,40 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaRequestExecution - # GRPC-method as condition. - attr_accessor :method + class BetaFeatureServiceGetInstanceFeaturesResponse + attr_accessor :details - # GRPC-service as condition. - attr_accessor :service + attr_accessor :login_default_org - # All calls to any available services and methods as condition. - attr_accessor :all + attr_accessor :oidc_trigger_introspection_projections + + attr_accessor :oidc_legacy_introspection + + attr_accessor :user_schema + + attr_accessor :oidc_token_exchange + + attr_accessor :improved_performance + + attr_accessor :web_key + + attr_accessor :debug_oidc_parent_error + + attr_accessor :oidc_single_v1_session_termination # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'method' => :'method', - :'service' => :'service', - :'all' => :'all' + :'details' => :'details', + :'login_default_org' => :'loginDefaultOrg', + :'oidc_trigger_introspection_projections' => :'oidcTriggerIntrospectionProjections', + :'oidc_legacy_introspection' => :'oidcLegacyIntrospection', + :'user_schema' => :'userSchema', + :'oidc_token_exchange' => :'oidcTokenExchange', + :'improved_performance' => :'improvedPerformance', + :'web_key' => :'webKey', + :'debug_oidc_parent_error' => :'debugOidcParentError', + :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination' } end @@ -46,9 +64,16 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'method' => :'String', - :'service' => :'String', - :'all' => :'Boolean' + :'details' => :'BetaFeatureServiceDetails', + :'login_default_org' => :'BetaFeatureServiceFeatureFlag', + :'oidc_trigger_introspection_projections' => :'BetaFeatureServiceFeatureFlag', + :'oidc_legacy_introspection' => :'BetaFeatureServiceFeatureFlag', + :'user_schema' => :'BetaFeatureServiceFeatureFlag', + :'oidc_token_exchange' => :'BetaFeatureServiceFeatureFlag', + :'improved_performance' => :'BetaFeatureServiceImprovedPerformanceFeatureFlag', + :'web_key' => :'BetaFeatureServiceFeatureFlag', + :'debug_oidc_parent_error' => :'BetaFeatureServiceFeatureFlag', + :'oidc_single_v1_session_termination' => :'BetaFeatureServiceFeatureFlag' } end @@ -63,7 +88,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaRequestExecution` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetInstanceFeaturesResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -71,93 +96,65 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaRequestExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'method') - self.method = attributes[:'method'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end - if attributes.key?(:'service') - self.service = attributes[:'service'] + if attributes.key?(:'login_default_org') + self.login_default_org = attributes[:'login_default_org'] end - if attributes.key?(:'all') - self.all = attributes[:'all'] + if attributes.key?(:'oidc_trigger_introspection_projections') + self.oidc_trigger_introspection_projections = attributes[:'oidc_trigger_introspection_projections'] end - end - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@method.nil? && @method.to_s.length > 1000 - invalid_properties.push('invalid value for "method", the character length must be smaller than or equal to 1000.') + if attributes.key?(:'oidc_legacy_introspection') + self.oidc_legacy_introspection = attributes[:'oidc_legacy_introspection'] end - if !@method.nil? && @method.to_s.length < 1 - invalid_properties.push('invalid value for "method", the character length must be great than or equal to 1.') + if attributes.key?(:'user_schema') + self.user_schema = attributes[:'user_schema'] end - if !@service.nil? && @service.to_s.length > 1000 - invalid_properties.push('invalid value for "service", the character length must be smaller than or equal to 1000.') + if attributes.key?(:'oidc_token_exchange') + self.oidc_token_exchange = attributes[:'oidc_token_exchange'] end - if !@service.nil? && @service.to_s.length < 1 - invalid_properties.push('invalid value for "service", the character length must be great than or equal to 1.') + if attributes.key?(:'improved_performance') + self.improved_performance = attributes[:'improved_performance'] end - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@method.nil? && @method.to_s.length > 1000 - return false if !@method.nil? && @method.to_s.length < 1 - return false if !@service.nil? && @service.to_s.length > 1000 - return false if !@service.nil? && @service.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] method Value to be assigned - def method=(method) - if method.nil? - fail ArgumentError, 'method cannot be nil' + if attributes.key?(:'web_key') + self.web_key = attributes[:'web_key'] end - if method.to_s.length > 1000 - fail ArgumentError, 'invalid value for "method", the character length must be smaller than or equal to 1000.' + if attributes.key?(:'debug_oidc_parent_error') + self.debug_oidc_parent_error = attributes[:'debug_oidc_parent_error'] end - if method.to_s.length < 1 - fail ArgumentError, 'invalid value for "method", the character length must be great than or equal to 1.' + if attributes.key?(:'oidc_single_v1_session_termination') + self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] end - - @method = method end - # Custom attribute writer method with validation - # @param [Object] service Value to be assigned - def service=(service) - if service.nil? - fail ArgumentError, 'service cannot be nil' - end - - if service.to_s.length > 1000 - fail ArgumentError, 'invalid value for "service", the character length must be smaller than or equal to 1000.' - end - - if service.to_s.length < 1 - fail ArgumentError, 'invalid value for "service", the character length must be great than or equal to 1.' - end + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end - @service = service + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true end # Checks equality by comparing each attribute. @@ -165,9 +162,16 @@ def service=(service) def ==(o) return true if self.equal?(o) self.class == o.class && - method == o.method && - service == o.service && - all == o.all + details == o.details && + login_default_org == o.login_default_org && + oidc_trigger_introspection_projections == o.oidc_trigger_introspection_projections && + oidc_legacy_introspection == o.oidc_legacy_introspection && + user_schema == o.user_schema && + oidc_token_exchange == o.oidc_token_exchange && + improved_performance == o.improved_performance && + web_key == o.web_key && + debug_oidc_parent_error == o.debug_oidc_parent_error && + oidc_single_v1_session_termination == o.oidc_single_v1_session_termination end # @see the `==` method @@ -179,7 +183,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [method, service, all].hash + [details, login_default_org, oidc_trigger_introspection_projections, oidc_legacy_introspection, user_schema, oidc_token_exchange, improved_performance, web_key, debug_oidc_parent_error, oidc_single_v1_session_termination].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_feature_service_get_organization_features_request.rb b/lib/zitadel/client/models/beta_feature_service_get_organization_features_request.rb new file mode 100644 index 00000000..36900bca --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_get_organization_features_request.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceGetOrganizationFeaturesRequest + attr_accessor :organization_id + + attr_accessor :inheritance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'inheritance' => :'inheritance' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'String', + :'inheritance' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetOrganizationFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'inheritance') + self.inheritance = attributes[:'inheritance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id && + inheritance == o.inheritance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id, inheritance].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_get_organization_features_response.rb b/lib/zitadel/client/models/beta_feature_service_get_organization_features_response.rb new file mode 100644 index 00000000..2a55a762 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_get_organization_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceGetOrganizationFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetOrganizationFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_response_execution.rb b/lib/zitadel/client/models/beta_feature_service_get_system_features_response.rb similarity index 66% rename from lib/zitadel/client/models/action_service_beta_response_execution.rb rename to lib/zitadel/client/models/beta_feature_service_get_system_features_response.rb index f360a029..f5c26526 100644 --- a/lib/zitadel/client/models/action_service_beta_response_execution.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_system_features_response.rb @@ -14,22 +14,34 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaResponseExecution - # GRPC-method as condition. - attr_accessor :method + class BetaFeatureServiceGetSystemFeaturesResponse + attr_accessor :details - # GRPC-service as condition. - attr_accessor :service + attr_accessor :login_default_org - # All calls to any available services and methods as condition. - attr_accessor :all + attr_accessor :oidc_trigger_introspection_projections + + attr_accessor :oidc_legacy_introspection + + attr_accessor :user_schema + + attr_accessor :oidc_token_exchange + + attr_accessor :improved_performance + + attr_accessor :oidc_single_v1_session_termination # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'method' => :'method', - :'service' => :'service', - :'all' => :'all' + :'details' => :'details', + :'login_default_org' => :'loginDefaultOrg', + :'oidc_trigger_introspection_projections' => :'oidcTriggerIntrospectionProjections', + :'oidc_legacy_introspection' => :'oidcLegacyIntrospection', + :'user_schema' => :'userSchema', + :'oidc_token_exchange' => :'oidcTokenExchange', + :'improved_performance' => :'improvedPerformance', + :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination' } end @@ -46,9 +58,14 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'method' => :'String', - :'service' => :'String', - :'all' => :'Boolean' + :'details' => :'BetaFeatureServiceDetails', + :'login_default_org' => :'BetaFeatureServiceFeatureFlag', + :'oidc_trigger_introspection_projections' => :'BetaFeatureServiceFeatureFlag', + :'oidc_legacy_introspection' => :'BetaFeatureServiceFeatureFlag', + :'user_schema' => :'BetaFeatureServiceFeatureFlag', + :'oidc_token_exchange' => :'BetaFeatureServiceFeatureFlag', + :'improved_performance' => :'BetaFeatureServiceImprovedPerformanceFeatureFlag', + :'oidc_single_v1_session_termination' => :'BetaFeatureServiceFeatureFlag' } end @@ -63,7 +80,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaResponseExecution` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetSystemFeaturesResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -71,45 +88,49 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaResponseExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'method') - self.method = attributes[:'method'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end - if attributes.key?(:'service') - self.service = attributes[:'service'] + if attributes.key?(:'login_default_org') + self.login_default_org = attributes[:'login_default_org'] end - if attributes.key?(:'all') - self.all = attributes[:'all'] + if attributes.key?(:'oidc_trigger_introspection_projections') + self.oidc_trigger_introspection_projections = attributes[:'oidc_trigger_introspection_projections'] end - end - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@method.nil? && @method.to_s.length > 1000 - invalid_properties.push('invalid value for "method", the character length must be smaller than or equal to 1000.') + if attributes.key?(:'oidc_legacy_introspection') + self.oidc_legacy_introspection = attributes[:'oidc_legacy_introspection'] end - if !@method.nil? && @method.to_s.length < 1 - invalid_properties.push('invalid value for "method", the character length must be great than or equal to 1.') + if attributes.key?(:'user_schema') + self.user_schema = attributes[:'user_schema'] end - if !@service.nil? && @service.to_s.length > 1000 - invalid_properties.push('invalid value for "service", the character length must be smaller than or equal to 1000.') + if attributes.key?(:'oidc_token_exchange') + self.oidc_token_exchange = attributes[:'oidc_token_exchange'] end - if !@service.nil? && @service.to_s.length < 1 - invalid_properties.push('invalid value for "service", the character length must be great than or equal to 1.') + if attributes.key?(:'improved_performance') + self.improved_performance = attributes[:'improved_performance'] end + if attributes.key?(:'oidc_single_v1_session_termination') + self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new invalid_properties end @@ -117,57 +138,22 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@method.nil? && @method.to_s.length > 1000 - return false if !@method.nil? && @method.to_s.length < 1 - return false if !@service.nil? && @service.to_s.length > 1000 - return false if !@service.nil? && @service.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] method Value to be assigned - def method=(method) - if method.nil? - fail ArgumentError, 'method cannot be nil' - end - - if method.to_s.length > 1000 - fail ArgumentError, 'invalid value for "method", the character length must be smaller than or equal to 1000.' - end - - if method.to_s.length < 1 - fail ArgumentError, 'invalid value for "method", the character length must be great than or equal to 1.' - end - - @method = method - end - - # Custom attribute writer method with validation - # @param [Object] service Value to be assigned - def service=(service) - if service.nil? - fail ArgumentError, 'service cannot be nil' - end - - if service.to_s.length > 1000 - fail ArgumentError, 'invalid value for "service", the character length must be smaller than or equal to 1000.' - end - - if service.to_s.length < 1 - fail ArgumentError, 'invalid value for "service", the character length must be great than or equal to 1.' - end - - @service = service - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - method == o.method && - service == o.service && - all == o.all + details == o.details && + login_default_org == o.login_default_org && + oidc_trigger_introspection_projections == o.oidc_trigger_introspection_projections && + oidc_legacy_introspection == o.oidc_legacy_introspection && + user_schema == o.user_schema && + oidc_token_exchange == o.oidc_token_exchange && + improved_performance == o.improved_performance && + oidc_single_v1_session_termination == o.oidc_single_v1_session_termination end # @see the `==` method @@ -179,7 +165,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [method, service, all].hash + [details, login_default_org, oidc_trigger_introspection_projections, oidc_legacy_introspection, user_schema, oidc_token_exchange, improved_performance, oidc_single_v1_session_termination].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_feature_service_get_user_features_request.rb b/lib/zitadel/client/models/beta_feature_service_get_user_features_request.rb new file mode 100644 index 00000000..bb52b29e --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_get_user_features_request.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceGetUserFeaturesRequest + attr_accessor :user_id + + attr_accessor :inheritance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'inheritance' => :'inheritance' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'inheritance' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetUserFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetUserFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'inheritance') + self.inheritance = attributes[:'inheritance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + inheritance == o.inheritance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, inheritance].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_get_user_features_response.rb b/lib/zitadel/client/models/beta_feature_service_get_user_features_response.rb new file mode 100644 index 00000000..c1e31fee --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_get_user_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceGetUserFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetUserFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_improved_performance.rb b/lib/zitadel/client/models/beta_feature_service_improved_performance.rb new file mode 100644 index 00000000..b52159c7 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_improved_performance.rb @@ -0,0 +1,45 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceImprovedPerformance + IMPROVED_PERFORMANCE_UNSPECIFIED = "IMPROVED_PERFORMANCE_UNSPECIFIED".freeze + IMPROVED_PERFORMANCE_ORG_BY_ID = "IMPROVED_PERFORMANCE_ORG_BY_ID".freeze + IMPROVED_PERFORMANCE_PROJECT_GRANT = "IMPROVED_PERFORMANCE_PROJECT_GRANT".freeze + IMPROVED_PERFORMANCE_PROJECT = "IMPROVED_PERFORMANCE_PROJECT".freeze + IMPROVED_PERFORMANCE_USER_GRANT = "IMPROVED_PERFORMANCE_USER_GRANT".freeze + IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = "IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED".freeze + + def self.all_vars + @all_vars ||= [IMPROVED_PERFORMANCE_UNSPECIFIED, IMPROVED_PERFORMANCE_ORG_BY_ID, IMPROVED_PERFORMANCE_PROJECT_GRANT, IMPROVED_PERFORMANCE_PROJECT, IMPROVED_PERFORMANCE_USER_GRANT, IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaFeatureServiceImprovedPerformance.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaFeatureServiceImprovedPerformance" + end + end + +end diff --git a/lib/zitadel/client/models/user_service_state_query.rb b/lib/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rb similarity index 88% rename from lib/zitadel/client/models/user_service_state_query.rb rename to lib/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rb index e81039e0..bdac033f 100644 --- a/lib/zitadel/client/models/user_service_state_query.rb +++ b/lib/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rb @@ -14,9 +14,10 @@ require 'time' module Zitadel::Client::Models - # Query for users with a specific state. - class UserServiceStateQuery - attr_accessor :state + class BetaFeatureServiceImprovedPerformanceFeatureFlag + attr_accessor :execution_paths + + attr_accessor :source class EnumAttributeValidator attr_reader :datatype @@ -43,7 +44,8 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'state' => :'state' + :'execution_paths' => :'executionPaths', + :'source' => :'source' } end @@ -60,7 +62,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'state' => :'UserServiceUserState' + :'execution_paths' => :'Array', + :'source' => :'BetaFeatureServiceSource' } end @@ -75,7 +78,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceStateQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceImprovedPerformanceFeatureFlag` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -83,15 +86,19 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceStateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceImprovedPerformanceFeatureFlag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'state') - self.state = attributes[:'state'] - else - self.state = 'USER_STATE_UNSPECIFIED' + if attributes.key?(:'execution_paths') + if (value = attributes[:'execution_paths']).is_a?(Array) + self.execution_paths = value + end + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] end end @@ -100,10 +107,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @state.nil? - invalid_properties.push('invalid value for "state", state cannot be nil.') - end - invalid_properties end @@ -111,26 +114,16 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @state.nil? true end - # Custom attribute writer method with validation - # @param [Object] state Value to be assigned - def state=(state) - if state.nil? - fail ArgumentError, 'state cannot be nil' - end - - @state = state - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - state == o.state + execution_paths == o.execution_paths && + source == o.source end # @see the `==` method @@ -142,7 +135,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [state].hash + [execution_paths, source].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_feature_service_reset_instance_features_response.rb b/lib/zitadel/client/models/beta_feature_service_reset_instance_features_response.rb new file mode 100644 index 00000000..8909ea3d --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_reset_instance_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceResetInstanceFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetInstanceFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_organization_features_request.rb b/lib/zitadel/client/models/beta_feature_service_reset_organization_features_request.rb new file mode 100644 index 00000000..3e435f14 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_reset_organization_features_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceResetOrganizationFeaturesRequest + attr_accessor :organization_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetOrganizationFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_organization_features_response.rb b/lib/zitadel/client/models/beta_feature_service_reset_organization_features_response.rb new file mode 100644 index 00000000..ba615871 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_reset_organization_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceResetOrganizationFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetOrganizationFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_system_features_response.rb b/lib/zitadel/client/models/beta_feature_service_reset_system_features_response.rb new file mode 100644 index 00000000..1b609ad5 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_reset_system_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceResetSystemFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetSystemFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_user_features_request.rb b/lib/zitadel/client/models/beta_feature_service_reset_user_features_request.rb new file mode 100644 index 00000000..c7bcbf56 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_reset_user_features_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceResetUserFeaturesRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetUserFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetUserFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_user_features_response.rb b/lib/zitadel/client/models/beta_feature_service_reset_user_features_response.rb new file mode 100644 index 00000000..dce76078 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_reset_user_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceResetUserFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetUserFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_send_email_verification_code.rb b/lib/zitadel/client/models/beta_feature_service_set_instance_features_request.rb similarity index 63% rename from lib/zitadel/client/models/organization_service_send_email_verification_code.rb rename to lib/zitadel/client/models/beta_feature_service_set_instance_features_request.rb index 9f0e07e6..d1151f56 100644 --- a/lib/zitadel/client/models/organization_service_send_email_verification_code.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_instance_features_request.rb @@ -14,14 +14,37 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceSendEmailVerificationCode - # Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code - attr_accessor :url_template + class BetaFeatureServiceSetInstanceFeaturesRequest + attr_accessor :login_default_org + + attr_accessor :oidc_trigger_introspection_projections + + attr_accessor :oidc_legacy_introspection + + attr_accessor :user_schema + + attr_accessor :oidc_token_exchange + + attr_accessor :improved_performance + + attr_accessor :web_key + + attr_accessor :debug_oidc_parent_error + + attr_accessor :oidc_single_v1_session_termination # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'url_template' => :'urlTemplate' + :'login_default_org' => :'loginDefaultOrg', + :'oidc_trigger_introspection_projections' => :'oidcTriggerIntrospectionProjections', + :'oidc_legacy_introspection' => :'oidcLegacyIntrospection', + :'user_schema' => :'userSchema', + :'oidc_token_exchange' => :'oidcTokenExchange', + :'improved_performance' => :'improvedPerformance', + :'web_key' => :'webKey', + :'debug_oidc_parent_error' => :'debugOidcParentError', + :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination' } end @@ -38,13 +61,29 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'url_template' => :'String' + :'login_default_org' => :'Boolean', + :'oidc_trigger_introspection_projections' => :'Boolean', + :'oidc_legacy_introspection' => :'Boolean', + :'user_schema' => :'Boolean', + :'oidc_token_exchange' => :'Boolean', + :'improved_performance' => :'Array', + :'web_key' => :'Boolean', + :'debug_oidc_parent_error' => :'Boolean', + :'oidc_single_v1_session_termination' => :'Boolean' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'login_default_org', + :'oidc_trigger_introspection_projections', + :'oidc_legacy_introspection', + :'user_schema', + :'oidc_token_exchange', + :'web_key', + :'debug_oidc_parent_error', + :'oidc_single_v1_session_termination' ]) end @@ -53,7 +92,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSendEmailVerificationCode` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetInstanceFeaturesRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +100,47 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSendEmailVerificationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetInstanceFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] + if attributes.key?(:'login_default_org') + self.login_default_org = attributes[:'login_default_org'] + end + + if attributes.key?(:'oidc_trigger_introspection_projections') + self.oidc_trigger_introspection_projections = attributes[:'oidc_trigger_introspection_projections'] + end + + if attributes.key?(:'oidc_legacy_introspection') + self.oidc_legacy_introspection = attributes[:'oidc_legacy_introspection'] + end + + if attributes.key?(:'user_schema') + self.user_schema = attributes[:'user_schema'] + end + + if attributes.key?(:'oidc_token_exchange') + self.oidc_token_exchange = attributes[:'oidc_token_exchange'] + end + + if attributes.key?(:'improved_performance') + if (value = attributes[:'improved_performance']).is_a?(Array) + self.improved_performance = value + end + end + + if attributes.key?(:'web_key') + self.web_key = attributes[:'web_key'] + end + + if attributes.key?(:'debug_oidc_parent_error') + self.debug_oidc_parent_error = attributes[:'debug_oidc_parent_error'] + end + + if attributes.key?(:'oidc_single_v1_session_termination') + self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] end end @@ -76,14 +149,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@url_template.nil? && @url_template.to_s.length > 200 - invalid_properties.push('invalid value for "url_template", the character length must be smaller than or equal to 200.') - end - - if !@url_template.nil? && @url_template.to_s.length < 1 - invalid_properties.push('invalid value for "url_template", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -91,35 +156,23 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@url_template.nil? && @url_template.to_s.length > 200 - return false if !@url_template.nil? && @url_template.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] url_template Value to be assigned - def url_template=(url_template) - if url_template.nil? - fail ArgumentError, 'url_template cannot be nil' - end - - if url_template.to_s.length > 200 - fail ArgumentError, 'invalid value for "url_template", the character length must be smaller than or equal to 200.' - end - - if url_template.to_s.length < 1 - fail ArgumentError, 'invalid value for "url_template", the character length must be great than or equal to 1.' - end - - @url_template = url_template - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - url_template == o.url_template + login_default_org == o.login_default_org && + oidc_trigger_introspection_projections == o.oidc_trigger_introspection_projections && + oidc_legacy_introspection == o.oidc_legacy_introspection && + user_schema == o.user_schema && + oidc_token_exchange == o.oidc_token_exchange && + improved_performance == o.improved_performance && + web_key == o.web_key && + debug_oidc_parent_error == o.debug_oidc_parent_error && + oidc_single_v1_session_termination == o.oidc_single_v1_session_termination end # @see the `==` method @@ -131,7 +184,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [url_template].hash + [login_default_org, oidc_trigger_introspection_projections, oidc_legacy_introspection, user_schema, oidc_token_exchange, improved_performance, web_key, debug_oidc_parent_error, oidc_single_v1_session_termination].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_feature_service_set_instance_features_response.rb b/lib/zitadel/client/models/beta_feature_service_set_instance_features_response.rb new file mode 100644 index 00000000..5cc0e61c --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_set_instance_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceSetInstanceFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetInstanceFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_set_organization_features_request.rb b/lib/zitadel/client/models/beta_feature_service_set_organization_features_request.rb new file mode 100644 index 00000000..0c469917 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_set_organization_features_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceSetOrganizationFeaturesRequest + attr_accessor :organization_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetOrganizationFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_set_organization_features_response.rb b/lib/zitadel/client/models/beta_feature_service_set_organization_features_response.rb new file mode 100644 index 00000000..b2a5f6b9 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_set_organization_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceSetOrganizationFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetOrganizationFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/s_a_m_l_service_session.rb b/lib/zitadel/client/models/beta_feature_service_set_system_features_request.rb similarity index 67% rename from lib/zitadel/client/models/s_a_m_l_service_session.rb rename to lib/zitadel/client/models/beta_feature_service_set_system_features_request.rb index 3f0d5004..355cefbb 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_session.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_system_features_request.rb @@ -14,18 +14,31 @@ require 'time' module Zitadel::Client::Models - class SAMLServiceSession - # ID of the session, used to login the user. Connects the session to the SAML Request. - attr_accessor :session_id + class BetaFeatureServiceSetSystemFeaturesRequest + attr_accessor :login_default_org - # Token to verify the session is valid. - attr_accessor :session_token + attr_accessor :oidc_trigger_introspection_projections + + attr_accessor :oidc_legacy_introspection + + attr_accessor :user_schema + + attr_accessor :oidc_token_exchange + + attr_accessor :improved_performance + + attr_accessor :oidc_single_v1_session_termination # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' + :'login_default_org' => :'loginDefaultOrg', + :'oidc_trigger_introspection_projections' => :'oidcTriggerIntrospectionProjections', + :'oidc_legacy_introspection' => :'oidcLegacyIntrospection', + :'user_schema' => :'userSchema', + :'oidc_token_exchange' => :'oidcTokenExchange', + :'improved_performance' => :'improvedPerformance', + :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination' } end @@ -42,14 +55,25 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'session_id' => :'String', - :'session_token' => :'String' + :'login_default_org' => :'Boolean', + :'oidc_trigger_introspection_projections' => :'Boolean', + :'oidc_legacy_introspection' => :'Boolean', + :'user_schema' => :'Boolean', + :'oidc_token_exchange' => :'Boolean', + :'improved_performance' => :'Array', + :'oidc_single_v1_session_termination' => :'Boolean' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'login_default_org', + :'oidc_trigger_introspection_projections', + :'oidc_legacy_introspection', + :'user_schema', + :'oidc_token_exchange', + :'oidc_single_v1_session_termination' ]) end @@ -58,7 +82,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceSession` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetSystemFeaturesRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,41 +90,47 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetSystemFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] + if attributes.key?(:'login_default_org') + self.login_default_org = attributes[:'login_default_org'] end - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] + if attributes.key?(:'oidc_trigger_introspection_projections') + self.oidc_trigger_introspection_projections = attributes[:'oidc_trigger_introspection_projections'] end - end - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@session_id.nil? && @session_id.to_s.length > 200 - invalid_properties.push('invalid value for "session_id", the character length must be smaller than or equal to 200.') + if attributes.key?(:'oidc_legacy_introspection') + self.oidc_legacy_introspection = attributes[:'oidc_legacy_introspection'] end - if !@session_id.nil? && @session_id.to_s.length < 1 - invalid_properties.push('invalid value for "session_id", the character length must be great than or equal to 1.') + if attributes.key?(:'user_schema') + self.user_schema = attributes[:'user_schema'] end - if !@session_token.nil? && @session_token.to_s.length > 200 - invalid_properties.push('invalid value for "session_token", the character length must be smaller than or equal to 200.') + if attributes.key?(:'oidc_token_exchange') + self.oidc_token_exchange = attributes[:'oidc_token_exchange'] end - if !@session_token.nil? && @session_token.to_s.length < 1 - invalid_properties.push('invalid value for "session_token", the character length must be great than or equal to 1.') + if attributes.key?(:'improved_performance') + if (value = attributes[:'improved_performance']).is_a?(Array) + self.improved_performance = value + end end + if attributes.key?(:'oidc_single_v1_session_termination') + self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new invalid_properties end @@ -108,56 +138,21 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@session_id.nil? && @session_id.to_s.length > 200 - return false if !@session_id.nil? && @session_id.to_s.length < 1 - return false if !@session_token.nil? && @session_token.to_s.length > 200 - return false if !@session_token.nil? && @session_token.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] session_id Value to be assigned - def session_id=(session_id) - if session_id.nil? - fail ArgumentError, 'session_id cannot be nil' - end - - if session_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "session_id", the character length must be smaller than or equal to 200.' - end - - if session_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "session_id", the character length must be great than or equal to 1.' - end - - @session_id = session_id - end - - # Custom attribute writer method with validation - # @param [Object] session_token Value to be assigned - def session_token=(session_token) - if session_token.nil? - fail ArgumentError, 'session_token cannot be nil' - end - - if session_token.to_s.length > 200 - fail ArgumentError, 'invalid value for "session_token", the character length must be smaller than or equal to 200.' - end - - if session_token.to_s.length < 1 - fail ArgumentError, 'invalid value for "session_token", the character length must be great than or equal to 1.' - end - - @session_token = session_token - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - session_id == o.session_id && - session_token == o.session_token + login_default_org == o.login_default_org && + oidc_trigger_introspection_projections == o.oidc_trigger_introspection_projections && + oidc_legacy_introspection == o.oidc_legacy_introspection && + user_schema == o.user_schema && + oidc_token_exchange == o.oidc_token_exchange && + improved_performance == o.improved_performance && + oidc_single_v1_session_termination == o.oidc_single_v1_session_termination end # @see the `==` method @@ -169,7 +164,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [session_id, session_token].hash + [login_default_org, oidc_trigger_introspection_projections, oidc_legacy_introspection, user_schema, oidc_token_exchange, improved_performance, oidc_single_v1_session_termination].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_feature_service_set_system_features_response.rb b/lib/zitadel/client/models/beta_feature_service_set_system_features_response.rb new file mode 100644 index 00000000..3e2002b2 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_set_system_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceSetSystemFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetSystemFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_set_user_feature_request.rb b/lib/zitadel/client/models/beta_feature_service_set_user_feature_request.rb new file mode 100644 index 00000000..86ba7c6f --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_set_user_feature_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceSetUserFeatureRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetUserFeatureRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetUserFeatureRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_set_user_features_response.rb b/lib/zitadel/client/models/beta_feature_service_set_user_features_response.rb new file mode 100644 index 00000000..979a94eb --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_set_user_features_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceSetUserFeaturesResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaFeatureServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetUserFeaturesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_feature_service_source.rb b/lib/zitadel/client/models/beta_feature_service_source.rb new file mode 100644 index 00000000..eff00b29 --- /dev/null +++ b/lib/zitadel/client/models/beta_feature_service_source.rb @@ -0,0 +1,46 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaFeatureServiceSource + SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED".freeze + SOURCE_SYSTEM = "SOURCE_SYSTEM".freeze + SOURCE_INSTANCE = "SOURCE_INSTANCE".freeze + SOURCE_ORGANIZATION = "SOURCE_ORGANIZATION".freeze + SOURCE_PROJECT = "SOURCE_PROJECT".freeze + SOURCE_APP = "SOURCE_APP".freeze + SOURCE_USER = "SOURCE_USER".freeze + + def self.all_vars + @all_vars ||= [SOURCE_UNSPECIFIED, SOURCE_SYSTEM, SOURCE_INSTANCE, SOURCE_ORGANIZATION, SOURCE_PROJECT, SOURCE_APP, SOURCE_USER].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaFeatureServiceSource.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaFeatureServiceSource" + end + end + +end diff --git a/lib/zitadel/client/models/user_service_or_query.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_any.rb similarity index 87% rename from lib/zitadel/client/models/user_service_or_query.rb rename to lib/zitadel/client/models/beta_o_i_d_c_service_any.rb index 2a00e6d0..8cc85de7 100644 --- a/lib/zitadel/client/models/user_service_or_query.rb +++ b/lib/zitadel/client/models/beta_o_i_d_c_service_any.rb @@ -14,15 +14,20 @@ require 'time' module Zitadel::Client::Models - # Connect multiple sub-condition with and OR operator. - class UserServiceOrQuery - # the sub queries to 'OR' - attr_accessor :queries + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class BetaOIDCServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'queries' => :'queries' + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' } end @@ -39,7 +44,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'queries' => :'Array' + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' } end @@ -54,7 +61,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceOrQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceAny` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -62,14 +69,22 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceOrQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value end end end @@ -94,7 +109,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - queries == o.queries + type == o.type && + value == o.value && + debug == o.debug end # @see the `==` method @@ -106,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [queries].hash + [type, value, debug].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_auth_request.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_auth_request.rb new file mode 100644 index 00000000..da4c6d77 --- /dev/null +++ b/lib/zitadel/client/models/beta_o_i_d_c_service_auth_request.rb @@ -0,0 +1,321 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaOIDCServiceAuthRequest + attr_accessor :id + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + attr_accessor :client_id + + attr_accessor :scope + + attr_accessor :redirect_uri + + attr_accessor :prompt + + attr_accessor :ui_locales + + attr_accessor :login_hint + + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + attr_accessor :max_age + + attr_accessor :hint_user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'creation_date' => :'creationDate', + :'client_id' => :'clientId', + :'scope' => :'scope', + :'redirect_uri' => :'redirectUri', + :'prompt' => :'prompt', + :'ui_locales' => :'uiLocales', + :'login_hint' => :'loginHint', + :'max_age' => :'maxAge', + :'hint_user_id' => :'hintUserId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'creation_date' => :'Time', + :'client_id' => :'String', + :'scope' => :'Array', + :'redirect_uri' => :'String', + :'prompt' => :'Array', + :'ui_locales' => :'Array', + :'login_hint' => :'String', + :'max_age' => :'String', + :'hint_user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'login_hint', + :'hint_user_id' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceAuthRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceAuthRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'scope') + if (value = attributes[:'scope']).is_a?(Array) + self.scope = value + end + end + + if attributes.key?(:'redirect_uri') + self.redirect_uri = attributes[:'redirect_uri'] + end + + if attributes.key?(:'prompt') + if (value = attributes[:'prompt']).is_a?(Array) + self.prompt = value + end + end + + if attributes.key?(:'ui_locales') + if (value = attributes[:'ui_locales']).is_a?(Array) + self.ui_locales = value + end + end + + if attributes.key?(:'login_hint') + self.login_hint = attributes[:'login_hint'] + end + + if attributes.key?(:'max_age') + self.max_age = attributes[:'max_age'] + end + + if attributes.key?(:'hint_user_id') + self.hint_user_id = attributes[:'hint_user_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + creation_date == o.creation_date && + client_id == o.client_id && + scope == o.scope && + redirect_uri == o.redirect_uri && + prompt == o.prompt && + ui_locales == o.ui_locales && + login_hint == o.login_hint && + max_age == o.max_age && + hint_user_id == o.hint_user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, creation_date, client_id, scope, redirect_uri, prompt, ui_locales, login_hint, max_age, hint_user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_display_name_query.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_connect_error.rb similarity index 76% rename from lib/zitadel/client/models/user_service_display_name_query.rb rename to lib/zitadel/client/models/beta_o_i_d_c_service_connect_error.rb index 9c3239bf..a19f1e9a 100644 --- a/lib/zitadel/client/models/user_service_display_name_query.rb +++ b/lib/zitadel/client/models/beta_o_i_d_c_service_connect_error.rb @@ -14,11 +14,15 @@ require 'time' module Zitadel::Client::Models - # Query for users with a specific display name. - class UserServiceDisplayNameQuery - attr_accessor :display_name + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaOIDCServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code - attr_accessor :method + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail class EnumAttributeValidator attr_reader :datatype @@ -45,8 +49,9 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'display_name' => :'displayName', - :'method' => :'method' + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' } end @@ -63,8 +68,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'display_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' + :'code' => :'String', + :'message' => :'String', + :'detail' => :'BetaOIDCServiceAny' } end @@ -79,7 +85,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDisplayNameQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceConnectError` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,21 +93,21 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDisplayNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - else - self.display_name = nil + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] end - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_QUERY_METHOD_EQUALS' + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] end end @@ -110,18 +116,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @display_name.nil? - invalid_properties.push('invalid value for "display_name", display_name cannot be nil.') - end - - if @display_name.to_s.length > 200 - invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 200.') - end - - if @display_name.to_s.length < 1 - invalid_properties.push('invalid value for "display_name", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -129,28 +123,19 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @display_name.nil? - return false if @display_name.to_s.length > 200 - return false if @display_name.to_s.length < 1 + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) true end - # Custom attribute writer method with validation - # @param [Object] display_name Value to be assigned - def display_name=(display_name) - if display_name.nil? - fail ArgumentError, 'display_name cannot be nil' - end - - if display_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 200.' + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." end - - if display_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "display_name", the character length must be great than or equal to 1.' - end - - @display_name = display_name + @code = code end # Checks equality by comparing each attribute. @@ -158,8 +143,9 @@ def display_name=(display_name) def ==(o) return true if self.equal?(o) self.class == o.class && - display_name == o.display_name && - method == o.method + code == o.code && + message == o.message && + detail == o.detail end # @see the `==` method @@ -171,7 +157,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [display_name, method].hash + [code, message, detail].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/web_key_service_beta_delete_web_key_response.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_response.rb similarity index 90% rename from lib/zitadel/client/models/web_key_service_beta_delete_web_key_response.rb rename to lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_response.rb index d70be513..44243acc 100644 --- a/lib/zitadel/client/models/web_key_service_beta_delete_web_key_response.rb +++ b/lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_response.rb @@ -14,14 +14,16 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaDeleteWebKeyResponse - # The timestamp of the deletion of the key. Note that the deletion date is only guaranteed to be set if the deletion was successful during the request. In case the deletion occurred in a previous request, the deletion date might be empty. - attr_accessor :deletion_date + class BetaOIDCServiceCreateCallbackResponse + attr_accessor :details + + attr_accessor :callback_url # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'deletion_date' => :'deletionDate' + :'details' => :'details', + :'callback_url' => :'callbackUrl' } end @@ -38,7 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'deletion_date' => :'Time' + :'details' => :'BetaOIDCServiceDetails', + :'callback_url' => :'String' } end @@ -53,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaDeleteWebKeyResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceCreateCallbackResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +64,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaDeleteWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceCreateCallbackResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'callback_url') + self.callback_url = attributes[:'callback_url'] end end @@ -91,7 +98,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - deletion_date == o.deletion_date + details == o.details && + callback_url == o.callback_url end # @see the `==` method @@ -103,7 +111,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [deletion_date].hash + [details, callback_url].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_details.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_details.rb new file mode 100644 index 00000000..f42a9995 --- /dev/null +++ b/lib/zitadel/client/models/beta_o_i_d_c_service_details.rb @@ -0,0 +1,262 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaOIDCServiceDetails + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + attr_accessor :sequence + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + # resource_owner is the organization or instance_id an object belongs to + attr_accessor :resource_owner + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'sequence' => :'sequence', + :'change_date' => :'changeDate', + :'resource_owner' => :'resourceOwner', + :'creation_date' => :'creationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'sequence' => :'Object', + :'change_date' => :'Time', + :'resource_owner' => :'String', + :'creation_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'sequence', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'sequence') + self.sequence = attributes[:'sequence'] + end + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'resource_owner') + self.resource_owner = attributes[:'resource_owner'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sequence == o.sequence && + change_date == o.change_date && + resource_owner == o.resource_owner && + creation_date == o.creation_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [sequence, change_date, resource_owner, creation_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_request.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_request.rb new file mode 100644 index 00000000..450088ff --- /dev/null +++ b/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaOIDCServiceGetAuthRequestRequest + attr_accessor :auth_request_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'auth_request_id' => :'authRequestId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'auth_request_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceGetAuthRequestRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceGetAuthRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'auth_request_id') + self.auth_request_id = attributes[:'auth_request_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth_request_id == o.auth_request_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [auth_request_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_response.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_response.rb new file mode 100644 index 00000000..e5e772fd --- /dev/null +++ b/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaOIDCServiceGetAuthRequestResponse + attr_accessor :auth_request + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'auth_request' => :'authRequest' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'auth_request' => :'BetaOIDCServiceAuthRequest' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceGetAuthRequestResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceGetAuthRequestResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'auth_request') + self.auth_request = attributes[:'auth_request'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth_request == o.auth_request + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [auth_request].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_binding.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_prompt.rb similarity index 63% rename from lib/zitadel/client/models/identity_provider_service_s_a_m_l_binding.rb rename to lib/zitadel/client/models/beta_o_i_d_c_service_prompt.rb index 1c637d74..6ef56bd4 100644 --- a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_binding.rb +++ b/lib/zitadel/client/models/beta_o_i_d_c_service_prompt.rb @@ -14,14 +14,16 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceSAMLBinding - SAML_BINDING_UNSPECIFIED = "SAML_BINDING_UNSPECIFIED".freeze - SAML_BINDING_POST = "SAML_BINDING_POST".freeze - SAML_BINDING_REDIRECT = "SAML_BINDING_REDIRECT".freeze - SAML_BINDING_ARTIFACT = "SAML_BINDING_ARTIFACT".freeze + class BetaOIDCServicePrompt + PROMPT_UNSPECIFIED = "PROMPT_UNSPECIFIED".freeze + PROMPT_NONE = "PROMPT_NONE".freeze + PROMPT_LOGIN = "PROMPT_LOGIN".freeze + PROMPT_CONSENT = "PROMPT_CONSENT".freeze + PROMPT_SELECT_ACCOUNT = "PROMPT_SELECT_ACCOUNT".freeze + PROMPT_CREATE = "PROMPT_CREATE".freeze def self.all_vars - @all_vars ||= [SAML_BINDING_UNSPECIFIED, SAML_BINDING_POST, SAML_BINDING_REDIRECT, SAML_BINDING_ARTIFACT].freeze + @all_vars ||= [PROMPT_UNSPECIFIED, PROMPT_NONE, PROMPT_LOGIN, PROMPT_CONSENT, PROMPT_SELECT_ACCOUNT, PROMPT_CREATE].freeze end # Builds the enum from string @@ -35,8 +37,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if IdentityProviderServiceSAMLBinding.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceSAMLBinding" + return value if BetaOIDCServicePrompt.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaOIDCServicePrompt" end end diff --git a/lib/zitadel/client/models/beta_oidc_service_create_callback_request.rb b/lib/zitadel/client/models/beta_oidc_service_create_callback_request.rb new file mode 100644 index 00000000..47a5d6a4 --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_create_callback_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaOIDCServiceCreateCallbackRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Error2', + :'Session2' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rb b/lib/zitadel/client/models/beta_organization_service_add_organization_request.rb similarity index 85% rename from lib/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rb rename to lib/zitadel/client/models/beta_organization_service_add_organization_request.rb index 6d5efebd..7945803a 100644 --- a/lib/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rb +++ b/lib/zitadel/client/models/beta_organization_service_add_organization_request.rb @@ -14,21 +14,16 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceGitLabSelfHostedConfig - attr_accessor :issuer + class BetaOrganizationServiceAddOrganizationRequest + attr_accessor :name - # Client id of the GitLab application. - attr_accessor :client_id - - # The scopes requested by ZITADEL during the request to GitLab. - attr_accessor :scopes + attr_accessor :admins # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'issuer' => :'issuer', - :'client_id' => :'clientId', - :'scopes' => :'scopes' + :'name' => :'name', + :'admins' => :'admins' } end @@ -45,9 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'issuer' => :'String', - :'client_id' => :'String', - :'scopes' => :'Array' + :'name' => :'String', + :'admins' => :'Array' } end @@ -62,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGitLabSelfHostedConfig` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAddOrganizationRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -70,22 +64,20 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGitLabSelfHostedConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAddOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'issuer') - self.issuer = attributes[:'issuer'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil end - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value + if attributes.key?(:'admins') + if (value = attributes[:'admins']).is_a?(Array) + self.admins = value end end end @@ -95,6 +87,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + invalid_properties end @@ -102,17 +98,27 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? true end + # Custom attribute writer method with validation + # @param [String] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - issuer == o.issuer && - client_id == o.client_id && - scopes == o.scopes + name == o.name && + admins == o.admins end # @see the `==` method @@ -124,7 +130,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [issuer, client_id, scopes].hash + [name, admins].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_organization_service_add_organization_response.rb b/lib/zitadel/client/models/beta_organization_service_add_organization_response.rb new file mode 100644 index 00000000..3a97ba82 --- /dev/null +++ b/lib/zitadel/client/models/beta_organization_service_add_organization_response.rb @@ -0,0 +1,250 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaOrganizationServiceAddOrganizationResponse + attr_accessor :details + + attr_accessor :organization_id + + attr_accessor :created_admins + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'organization_id' => :'organizationId', + :'created_admins' => :'createdAdmins' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaOrganizationServiceDetails', + :'organization_id' => :'String', + :'created_admins' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAddOrganizationResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAddOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'created_admins') + if (value = attributes[:'created_admins']).is_a?(Array) + self.created_admins = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + organization_id == o.organization_id && + created_admins == o.created_admins + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, organization_id, created_admins].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_organization_service_admin.rb b/lib/zitadel/client/models/beta_organization_service_admin.rb new file mode 100644 index 00000000..4df39a66 --- /dev/null +++ b/lib/zitadel/client/models/beta_organization_service_admin.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaOrganizationServiceAdmin + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Human2', + :'UserId' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_organization_service_any.rb b/lib/zitadel/client/models/beta_organization_service_any.rb new file mode 100644 index 00000000..6ad03121 --- /dev/null +++ b/lib/zitadel/client/models/beta_organization_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class BetaOrganizationServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_organization_service_connect_error.rb b/lib/zitadel/client/models/beta_organization_service_connect_error.rb new file mode 100644 index 00000000..e5cdc414 --- /dev/null +++ b/lib/zitadel/client/models/beta_organization_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaOrganizationServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'BetaOrganizationServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_add_organization_response_created_admin.rb b/lib/zitadel/client/models/beta_organization_service_created_admin.rb similarity index 95% rename from lib/zitadel/client/models/organization_service_add_organization_response_created_admin.rb rename to lib/zitadel/client/models/beta_organization_service_created_admin.rb index 9f746208..2ec0c967 100644 --- a/lib/zitadel/client/models/organization_service_add_organization_response_created_admin.rb +++ b/lib/zitadel/client/models/beta_organization_service_created_admin.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceAddOrganizationResponseCreatedAdmin + class BetaOrganizationServiceCreatedAdmin attr_accessor :user_id attr_accessor :email_code @@ -52,6 +52,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'email_code', + :'phone_code' ]) end @@ -60,7 +62,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAddOrganizationResponseCreatedAdmin` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceCreatedAdmin` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,7 +70,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAddOrganizationResponseCreatedAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceCreatedAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/beta_organization_service_details.rb b/lib/zitadel/client/models/beta_organization_service_details.rb new file mode 100644 index 00000000..ff4b4eb0 --- /dev/null +++ b/lib/zitadel/client/models/beta_organization_service_details.rb @@ -0,0 +1,262 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaOrganizationServiceDetails + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + attr_accessor :sequence + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + # resource_owner is the organization or instance_id an object belongs to + attr_accessor :resource_owner + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'sequence' => :'sequence', + :'change_date' => :'changeDate', + :'resource_owner' => :'resourceOwner', + :'creation_date' => :'creationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'sequence' => :'Object', + :'change_date' => :'Time', + :'resource_owner' => :'String', + :'creation_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'sequence', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'sequence') + self.sequence = attributes[:'sequence'] + end + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'resource_owner') + self.resource_owner = attributes[:'resource_owner'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sequence == o.sequence && + change_date == o.change_date && + resource_owner == o.resource_owner && + creation_date == o.creation_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [sequence, change_date, resource_owner, creation_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_any.rb b/lib/zitadel/client/models/beta_session_service_any.rb new file mode 100644 index 00000000..7da0401e --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class BetaSessionServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_challenges.rb b/lib/zitadel/client/models/beta_session_service_challenges.rb new file mode 100644 index 00000000..c77e7c12 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_challenges.rb @@ -0,0 +1,250 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceChallenges + attr_accessor :web_auth_n + + attr_accessor :otp_sms + + attr_accessor :otp_email + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'web_auth_n' => :'webAuthN', + :'otp_sms' => :'otpSms', + :'otp_email' => :'otpEmail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'web_auth_n' => :'BetaSessionServiceWebAuthN', + :'otp_sms' => :'String', + :'otp_email' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'otp_sms', + :'otp_email' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceChallenges` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceChallenges`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'web_auth_n') + self.web_auth_n = attributes[:'web_auth_n'] + end + + if attributes.key?(:'otp_sms') + self.otp_sms = attributes[:'otp_sms'] + end + + if attributes.key?(:'otp_email') + self.otp_email = attributes[:'otp_email'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + web_auth_n == o.web_auth_n && + otp_sms == o.otp_sms && + otp_email == o.otp_email + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [web_auth_n, otp_sms, otp_email].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_check_i_d_p_intent.rb b/lib/zitadel/client/models/beta_session_service_check_i_d_p_intent.rb new file mode 100644 index 00000000..b01b22cf --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_check_i_d_p_intent.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceCheckIDPIntent + attr_accessor :idp_intent_id + + attr_accessor :idp_intent_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'idp_intent_id' => :'idpIntentId', + :'idp_intent_token' => :'idpIntentToken' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'idp_intent_id' => :'String', + :'idp_intent_token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckIDPIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckIDPIntent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'idp_intent_id') + self.idp_intent_id = attributes[:'idp_intent_id'] + end + + if attributes.key?(:'idp_intent_token') + self.idp_intent_token = attributes[:'idp_intent_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + idp_intent_id == o.idp_intent_id && + idp_intent_token == o.idp_intent_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [idp_intent_id, idp_intent_token].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_protobuf_any.rb b/lib/zitadel/client/models/beta_session_service_check_o_t_p.rb similarity index 94% rename from lib/zitadel/client/models/settings_service_protobuf_any.rb rename to lib/zitadel/client/models/beta_session_service_check_o_t_p.rb index 8b94f40c..87a1fc73 100644 --- a/lib/zitadel/client/models/settings_service_protobuf_any.rb +++ b/lib/zitadel/client/models/beta_session_service_check_o_t_p.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class SettingsServiceProtobufAny - attr_accessor :type + class BetaSessionServiceCheckOTP + attr_accessor :code # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'code' => :'code' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'code' => :'String' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckOTP` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckOTP`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'code') + self.code = attributes[:'code'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + code == o.code end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_check_password.rb b/lib/zitadel/client/models/beta_session_service_check_password.rb new file mode 100644 index 00000000..e767916f --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_check_password.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceCheckPassword + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'password' => :'password' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'password' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckPassword` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [password].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_protobuf_any.rb b/lib/zitadel/client/models/beta_session_service_check_t_o_t_p.rb similarity index 93% rename from lib/zitadel/client/models/feature_service_protobuf_any.rb rename to lib/zitadel/client/models/beta_session_service_check_t_o_t_p.rb index 788683c1..0dc918ae 100644 --- a/lib/zitadel/client/models/feature_service_protobuf_any.rb +++ b/lib/zitadel/client/models/beta_session_service_check_t_o_t_p.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class FeatureServiceProtobufAny - attr_accessor :type + class BetaSessionServiceCheckTOTP + attr_accessor :code # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'code' => :'code' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'code' => :'String' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckTOTP` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckTOTP`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'code') + self.code = attributes[:'code'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + code == o.code end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_check_user.rb b/lib/zitadel/client/models/beta_session_service_check_user.rb new file mode 100644 index 00000000..0126c7f4 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_check_user.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaSessionServiceCheckUser + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LoginName', + :'UserId' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_session_service_check_web_auth_n.rb b/lib/zitadel/client/models/beta_session_service_check_web_auth_n.rb new file mode 100644 index 00000000..8ed2de44 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_check_web_auth_n.rb @@ -0,0 +1,250 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceCheckWebAuthN + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + attr_accessor :credential_assertion_data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'credential_assertion_data' => :'credentialAssertionData' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'credential_assertion_data' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckWebAuthN` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'credential_assertion_data') + if (value = attributes[:'credential_assertion_data']).is_a?(Hash) + self.credential_assertion_data = value + end + else + self.credential_assertion_data = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @credential_assertion_data.nil? + invalid_properties.push('invalid value for "credential_assertion_data", credential_assertion_data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @credential_assertion_data.nil? + true + end + + # Custom attribute writer method with validation + # @param [Hash] credential_assertion_data Value to be assigned + def credential_assertion_data=(credential_assertion_data) + if credential_assertion_data.nil? + fail ArgumentError, 'credential_assertion_data cannot be nil' + end + + @credential_assertion_data = credential_assertion_data + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + credential_assertion_data == o.credential_assertion_data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [credential_assertion_data].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_rpc_status.rb b/lib/zitadel/client/models/beta_session_service_checks.rb similarity index 77% rename from lib/zitadel/client/models/settings_service_rpc_status.rb rename to lib/zitadel/client/models/beta_session_service_checks.rb index 0c9e3e3f..6b286e00 100644 --- a/lib/zitadel/client/models/settings_service_rpc_status.rb +++ b/lib/zitadel/client/models/beta_session_service_checks.rb @@ -14,19 +14,31 @@ require 'time' module Zitadel::Client::Models - class SettingsServiceRpcStatus - attr_accessor :code + class BetaSessionServiceChecks + attr_accessor :user - attr_accessor :message + attr_accessor :password - attr_accessor :details + attr_accessor :web_auth_n + + attr_accessor :idp_intent + + attr_accessor :totp + + attr_accessor :otp_sms + + attr_accessor :otp_email # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'user' => :'user', + :'password' => :'password', + :'web_auth_n' => :'webAuthN', + :'idp_intent' => :'idpIntent', + :'totp' => :'totp', + :'otp_sms' => :'otpSms', + :'otp_email' => :'otpEmail' } end @@ -43,9 +55,13 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'user' => :'BetaSessionServiceCheckUser', + :'password' => :'BetaSessionServiceCheckPassword', + :'web_auth_n' => :'BetaSessionServiceCheckWebAuthN', + :'idp_intent' => :'BetaSessionServiceCheckIDPIntent', + :'totp' => :'BetaSessionServiceCheckTOTP', + :'otp_sms' => :'BetaSessionServiceCheckOTP', + :'otp_email' => :'BetaSessionServiceCheckOTP' } end @@ -60,7 +76,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceChecks` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,23 +84,37 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceChecks`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] + if attributes.key?(:'user') + self.user = attributes[:'user'] end - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'password') + self.password = attributes[:'password'] end - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end + if attributes.key?(:'web_auth_n') + self.web_auth_n = attributes[:'web_auth_n'] + end + + if attributes.key?(:'idp_intent') + self.idp_intent = attributes[:'idp_intent'] + end + + if attributes.key?(:'totp') + self.totp = attributes[:'totp'] + end + + if attributes.key?(:'otp_sms') + self.otp_sms = attributes[:'otp_sms'] + end + + if attributes.key?(:'otp_email') + self.otp_email = attributes[:'otp_email'] end end @@ -108,9 +138,13 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + user == o.user && + password == o.password && + web_auth_n == o.web_auth_n && + idp_intent == o.idp_intent && + totp == o.totp && + otp_sms == o.otp_sms && + otp_email == o.otp_email end # @see the `==` method @@ -122,7 +156,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [user, password, web_auth_n, idp_intent, totp, otp_sms, otp_email].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_connect_error.rb b/lib/zitadel/client/models/beta_session_service_connect_error.rb new file mode 100644 index 00000000..b841d019 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaSessionServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'BetaSessionServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_send_passkey_registration_link.rb b/lib/zitadel/client/models/beta_session_service_create_session_request.rb similarity index 65% rename from lib/zitadel/client/models/user_service_send_passkey_registration_link.rb rename to lib/zitadel/client/models/beta_session_service_create_session_request.rb index 1e330b68..e6a30bca 100644 --- a/lib/zitadel/client/models/user_service_send_passkey_registration_link.rb +++ b/lib/zitadel/client/models/beta_session_service_create_session_request.rb @@ -14,14 +14,26 @@ require 'time' module Zitadel::Client::Models - class UserServiceSendPasskeyRegistrationLink - # Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your passkey registration page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, CodeID, Code - attr_accessor :url_template + class BetaSessionServiceCreateSessionRequest + attr_accessor :checks + + attr_accessor :metadata + + attr_accessor :challenges + + attr_accessor :user_agent + + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + attr_accessor :lifetime # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'url_template' => :'urlTemplate' + :'checks' => :'checks', + :'metadata' => :'metadata', + :'challenges' => :'challenges', + :'user_agent' => :'userAgent', + :'lifetime' => :'lifetime' } end @@ -38,7 +50,11 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'url_template' => :'String' + :'checks' => :'BetaSessionServiceChecks', + :'metadata' => :'Hash', + :'challenges' => :'BetaSessionServiceRequestChallenges', + :'user_agent' => :'BetaSessionServiceUserAgent', + :'lifetime' => :'String' } end @@ -53,7 +69,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendPasskeyRegistrationLink` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCreateSessionRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +77,31 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendPasskeyRegistrationLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCreateSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] + if attributes.key?(:'checks') + self.checks = attributes[:'checks'] + end + + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'challenges') + self.challenges = attributes[:'challenges'] + end + + if attributes.key?(:'user_agent') + self.user_agent = attributes[:'user_agent'] + end + + if attributes.key?(:'lifetime') + self.lifetime = attributes[:'lifetime'] end end @@ -76,14 +110,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@url_template.nil? && @url_template.to_s.length > 200 - invalid_properties.push('invalid value for "url_template", the character length must be smaller than or equal to 200.') - end - - if !@url_template.nil? && @url_template.to_s.length < 1 - invalid_properties.push('invalid value for "url_template", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -91,35 +117,19 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@url_template.nil? && @url_template.to_s.length > 200 - return false if !@url_template.nil? && @url_template.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] url_template Value to be assigned - def url_template=(url_template) - if url_template.nil? - fail ArgumentError, 'url_template cannot be nil' - end - - if url_template.to_s.length > 200 - fail ArgumentError, 'invalid value for "url_template", the character length must be smaller than or equal to 200.' - end - - if url_template.to_s.length < 1 - fail ArgumentError, 'invalid value for "url_template", the character length must be great than or equal to 1.' - end - - @url_template = url_template - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - url_template == o.url_template + checks == o.checks && + metadata == o.metadata && + challenges == o.challenges && + user_agent == o.user_agent && + lifetime == o.lifetime end # @see the `==` method @@ -131,7 +141,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [url_template].hash + [checks, metadata, challenges, user_agent, lifetime].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_create_session_response.rb b/lib/zitadel/client/models/beta_session_service_create_session_response.rb new file mode 100644 index 00000000..891f2b22 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_create_session_response.rb @@ -0,0 +1,257 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceCreateSessionResponse + attr_accessor :details + + attr_accessor :session_id + + attr_accessor :session_token + + attr_accessor :challenges + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'session_id' => :'sessionId', + :'session_token' => :'sessionToken', + :'challenges' => :'challenges' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSessionServiceDetails', + :'session_id' => :'String', + :'session_token' => :'String', + :'challenges' => :'BetaSessionServiceChallenges' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCreateSessionResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCreateSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'session_id') + self.session_id = attributes[:'session_id'] + end + + if attributes.key?(:'session_token') + self.session_token = attributes[:'session_token'] + end + + if attributes.key?(:'challenges') + self.challenges = attributes[:'challenges'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + session_id == o.session_id && + session_token == o.session_token && + challenges == o.challenges + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, session_id, session_token, challenges].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_delete_session_request.rb b/lib/zitadel/client/models/beta_session_service_delete_session_request.rb new file mode 100644 index 00000000..3866db56 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_delete_session_request.rb @@ -0,0 +1,240 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceDeleteSessionRequest + attr_accessor :session_id + + attr_accessor :session_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session_id' => :'sessionId', + :'session_token' => :'sessionToken' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'session_id' => :'String', + :'session_token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'session_token' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceDeleteSessionRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceDeleteSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session_id') + self.session_id = attributes[:'session_id'] + end + + if attributes.key?(:'session_token') + self.session_token = attributes[:'session_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session_id == o.session_id && + session_token == o.session_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session_id, session_token].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_activate_web_key_response.rb b/lib/zitadel/client/models/beta_session_service_delete_session_response.rb similarity index 92% rename from lib/zitadel/client/models/web_key_service_beta_activate_web_key_response.rb rename to lib/zitadel/client/models/beta_session_service_delete_session_response.rb index 3f3c8a5b..ed1307aa 100644 --- a/lib/zitadel/client/models/web_key_service_beta_activate_web_key_response.rb +++ b/lib/zitadel/client/models/beta_session_service_delete_session_response.rb @@ -14,14 +14,13 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaActivateWebKeyResponse - # The timestamp of the activation of the key. - attr_accessor :change_date + class BetaSessionServiceDeleteSessionResponse + attr_accessor :details # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'change_date' => :'changeDate' + :'details' => :'details' } end @@ -38,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'change_date' => :'Time' + :'details' => :'BetaSessionServiceDetails' } end @@ -53,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaActivateWebKeyResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceDeleteSessionResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaActivateWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceDeleteSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end end @@ -91,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - change_date == o.change_date + details == o.details end # @see the `==` method @@ -103,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [change_date].hash + [details].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_details.rb b/lib/zitadel/client/models/beta_session_service_details.rb new file mode 100644 index 00000000..8f02bae9 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_details.rb @@ -0,0 +1,262 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceDetails + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + attr_accessor :sequence + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + # resource_owner is the organization or instance_id an object belongs to + attr_accessor :resource_owner + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'sequence' => :'sequence', + :'change_date' => :'changeDate', + :'resource_owner' => :'resourceOwner', + :'creation_date' => :'creationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'sequence' => :'Object', + :'change_date' => :'Time', + :'resource_owner' => :'String', + :'creation_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'sequence', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'sequence') + self.sequence = attributes[:'sequence'] + end + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'resource_owner') + self.resource_owner = attributes[:'resource_owner'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sequence == o.sequence && + change_date == o.change_date && + resource_owner == o.resource_owner && + creation_date == o.creation_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [sequence, change_date, resource_owner, creation_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_r_e_s_t_call.rb b/lib/zitadel/client/models/beta_session_service_factors.rb similarity index 77% rename from lib/zitadel/client/models/action_service_beta_r_e_s_t_call.rb rename to lib/zitadel/client/models/beta_session_service_factors.rb index 1e035b0b..499adfa9 100644 --- a/lib/zitadel/client/models/action_service_beta_r_e_s_t_call.rb +++ b/lib/zitadel/client/models/beta_session_service_factors.rb @@ -14,14 +14,31 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaRESTCall - # Define if any error stops the whole execution. By default the process continues as normal. - attr_accessor :interrupt_on_error + class BetaSessionServiceFactors + attr_accessor :user + + attr_accessor :password + + attr_accessor :web_auth_n + + attr_accessor :intent + + attr_accessor :totp + + attr_accessor :otp_sms + + attr_accessor :otp_email # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'interrupt_on_error' => :'interruptOnError' + :'user' => :'user', + :'password' => :'password', + :'web_auth_n' => :'webAuthN', + :'intent' => :'intent', + :'totp' => :'totp', + :'otp_sms' => :'otpSms', + :'otp_email' => :'otpEmail' } end @@ -38,7 +55,13 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'interrupt_on_error' => :'Boolean' + :'user' => :'BetaSessionServiceUserFactor', + :'password' => :'BetaSessionServicePasswordFactor', + :'web_auth_n' => :'BetaSessionServiceWebAuthNFactor', + :'intent' => :'BetaSessionServiceIntentFactor', + :'totp' => :'BetaSessionServiceTOTPFactor', + :'otp_sms' => :'BetaSessionServiceOTPFactor', + :'otp_email' => :'BetaSessionServiceOTPFactor' } end @@ -53,7 +76,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaRESTCall` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceFactors` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +84,37 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaRESTCall`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceFactors`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'interrupt_on_error') - self.interrupt_on_error = attributes[:'interrupt_on_error'] + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'web_auth_n') + self.web_auth_n = attributes[:'web_auth_n'] + end + + if attributes.key?(:'intent') + self.intent = attributes[:'intent'] + end + + if attributes.key?(:'totp') + self.totp = attributes[:'totp'] + end + + if attributes.key?(:'otp_sms') + self.otp_sms = attributes[:'otp_sms'] + end + + if attributes.key?(:'otp_email') + self.otp_email = attributes[:'otp_email'] end end @@ -91,7 +138,13 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - interrupt_on_error == o.interrupt_on_error + user == o.user && + password == o.password && + web_auth_n == o.web_auth_n && + intent == o.intent && + totp == o.totp && + otp_sms == o.otp_sms && + otp_email == o.otp_email end # @see the `==` method @@ -103,7 +156,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [interrupt_on_error].hash + [user, password, web_auth_n, intent, totp, otp_sms, otp_email].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/identity_provider_service_git_hub_config.rb b/lib/zitadel/client/models/beta_session_service_get_session_request.rb similarity index 89% rename from lib/zitadel/client/models/identity_provider_service_git_hub_config.rb rename to lib/zitadel/client/models/beta_session_service_get_session_request.rb index 6fdcf8e6..4acdf07e 100644 --- a/lib/zitadel/client/models/identity_provider_service_git_hub_config.rb +++ b/lib/zitadel/client/models/beta_session_service_get_session_request.rb @@ -14,18 +14,16 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceGitHubConfig - # The client ID of the GitHub App. - attr_accessor :client_id + class BetaSessionServiceGetSessionRequest + attr_accessor :session_id - # The scopes requested by ZITADEL during the request to GitHub. - attr_accessor :scopes + attr_accessor :session_token # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'client_id' => :'clientId', - :'scopes' => :'scopes' + :'session_id' => :'sessionId', + :'session_token' => :'sessionToken' } end @@ -42,14 +40,15 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'client_id' => :'String', - :'scopes' => :'Array' + :'session_id' => :'String', + :'session_token' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'session_token' ]) end @@ -58,7 +57,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGitHubConfig` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceGetSessionRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,19 +65,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGitHubConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceGetSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] + if attributes.key?(:'session_id') + self.session_id = attributes[:'session_id'] end - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end + if attributes.key?(:'session_token') + self.session_token = attributes[:'session_token'] end end @@ -102,8 +99,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - client_id == o.client_id && - scopes == o.scopes + session_id == o.session_id && + session_token == o.session_token end # @see the `==` method @@ -115,7 +112,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [client_id, scopes].hash + [session_id, session_token].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_get_session_response.rb b/lib/zitadel/client/models/beta_session_service_get_session_response.rb new file mode 100644 index 00000000..2ac04def --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_get_session_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceGetSessionResponse + attr_accessor :session + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session' => :'session' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'session' => :'BetaSessionServiceSession' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceGetSessionResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceGetSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session') + self.session = attributes[:'session'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session == o.session + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_user_agent_header_values.rb b/lib/zitadel/client/models/beta_session_service_header_values.rb similarity index 94% rename from lib/zitadel/client/models/session_service_user_agent_header_values.rb rename to lib/zitadel/client/models/beta_session_service_header_values.rb index 8ff13cfb..c76ba875 100644 --- a/lib/zitadel/client/models/session_service_user_agent_header_values.rb +++ b/lib/zitadel/client/models/beta_session_service_header_values.rb @@ -14,8 +14,8 @@ require 'time' module Zitadel::Client::Models - # A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. - class SessionServiceUserAgentHeaderValues + # A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. + class BetaSessionServiceHeaderValues attr_accessor :values # Attribute mapping from ruby-style variable name to JSON key. @@ -53,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceUserAgentHeaderValues` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceHeaderValues` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,7 +61,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceUserAgentHeaderValues`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceHeaderValues`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/session_service_o_t_p_email_send_code.rb b/lib/zitadel/client/models/beta_session_service_intent_factor.rb similarity index 61% rename from lib/zitadel/client/models/session_service_o_t_p_email_send_code.rb rename to lib/zitadel/client/models/beta_session_service_intent_factor.rb index 5d961491..1357ce3c 100644 --- a/lib/zitadel/client/models/session_service_o_t_p_email_send_code.rb +++ b/lib/zitadel/client/models/beta_session_service_intent_factor.rb @@ -14,14 +14,14 @@ require 'time' module Zitadel::Client::Models - class SessionServiceOTPEmailSendCode - # Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: Code, UserID, LoginName, DisplayName, PreferredLanguage, SessionID - attr_accessor :url_template + class BetaSessionServiceIntentFactor + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :verified_at # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'url_template' => :'urlTemplate' + :'verified_at' => :'verifiedAt' } end @@ -38,7 +38,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'url_template' => :'String' + :'verified_at' => :'Time' } end @@ -53,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceOTPEmailSendCode` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceIntentFactor` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +61,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceOTPEmailSendCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceIntentFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] + if attributes.key?(:'verified_at') + self.verified_at = attributes[:'verified_at'] end end @@ -76,14 +76,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@url_template.nil? && @url_template.to_s.length > 200 - invalid_properties.push('invalid value for "url_template", the character length must be smaller than or equal to 200.') - end - - if !@url_template.nil? && @url_template.to_s.length < 1 - invalid_properties.push('invalid value for "url_template", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -91,35 +83,15 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@url_template.nil? && @url_template.to_s.length > 200 - return false if !@url_template.nil? && @url_template.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] url_template Value to be assigned - def url_template=(url_template) - if url_template.nil? - fail ArgumentError, 'url_template cannot be nil' - end - - if url_template.to_s.length > 200 - fail ArgumentError, 'invalid value for "url_template", the character length must be smaller than or equal to 200.' - end - - if url_template.to_s.length < 1 - fail ArgumentError, 'invalid value for "url_template", the character length must be great than or equal to 1.' - end - - @url_template = url_template - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - url_template == o.url_template + verified_at == o.verified_at end # @see the `==` method @@ -131,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [url_template].hash + [verified_at].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_list_details.rb b/lib/zitadel/client/models/beta_session_service_list_details.rb new file mode 100644 index 00000000..30fff4be --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_list_details.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceListDetails + attr_accessor :total_result + + attr_accessor :processed_sequence + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :timestamp + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'total_result' => :'totalResult', + :'processed_sequence' => :'processedSequence', + :'timestamp' => :'timestamp' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'total_result' => :'Object', + :'processed_sequence' => :'Object', + :'timestamp' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'total_result', + :'processed_sequence', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceListDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'total_result') + self.total_result = attributes[:'total_result'] + end + + if attributes.key?(:'processed_sequence') + self.processed_sequence = attributes[:'processed_sequence'] + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_result == o.total_result && + processed_sequence == o.processed_sequence && + timestamp == o.timestamp + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [total_result, processed_sequence, timestamp].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_list_query.rb b/lib/zitadel/client/models/beta_session_service_list_query.rb new file mode 100644 index 00000000..31fdc626 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_list_query.rb @@ -0,0 +1,249 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceListQuery + attr_accessor :offset + + attr_accessor :limit + + attr_accessor :asc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'offset' => :'offset', + :'limit' => :'limit', + :'asc' => :'asc' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'offset' => :'Object', + :'limit' => :'Integer', + :'asc' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'offset', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceListQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceListQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'offset') + self.offset = attributes[:'offset'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'asc') + self.asc = attributes[:'asc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + offset == o.offset && + limit == o.limit && + asc == o.asc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [offset, limit, asc].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_list_sessions_request.rb b/lib/zitadel/client/models/beta_session_service_list_sessions_request.rb new file mode 100644 index 00000000..e49e91b3 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_list_sessions_request.rb @@ -0,0 +1,272 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceListSessionsRequest + attr_accessor :query + + attr_accessor :queries + + attr_accessor :sorting_column + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'query' => :'query', + :'queries' => :'queries', + :'sorting_column' => :'sortingColumn' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'query' => :'BetaSessionServiceListQuery', + :'queries' => :'Array', + :'sorting_column' => :'BetaSessionServiceSessionFieldName' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceListSessionsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceListSessionsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'queries') + if (value = attributes[:'queries']).is_a?(Array) + self.queries = value + end + end + + if attributes.key?(:'sorting_column') + self.sorting_column = attributes[:'sorting_column'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + query == o.query && + queries == o.queries && + sorting_column == o.sorting_column + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [query, queries, sorting_column].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_list_sessions_response.rb b/lib/zitadel/client/models/beta_session_service_list_sessions_response.rb new file mode 100644 index 00000000..751bf177 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_list_sessions_response.rb @@ -0,0 +1,241 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceListSessionsResponse + attr_accessor :details + + attr_accessor :sessions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'sessions' => :'sessions' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSessionServiceListDetails', + :'sessions' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceListSessionsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceListSessionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'sessions') + if (value = attributes[:'sessions']).is_a?(Array) + self.sessions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + sessions == o.sessions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, sessions].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_o_auth_config.rb b/lib/zitadel/client/models/beta_session_service_o_t_p_factor.rb similarity index 60% rename from lib/zitadel/client/models/identity_provider_service_o_auth_config.rb rename to lib/zitadel/client/models/beta_session_service_o_t_p_factor.rb index 6a36b30b..e8188f95 100644 --- a/lib/zitadel/client/models/identity_provider_service_o_auth_config.rb +++ b/lib/zitadel/client/models/beta_session_service_o_t_p_factor.rb @@ -14,34 +14,14 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceOAuthConfig - # Client id generated by the identity provider. - attr_accessor :client_id - - # The endpoint where ZITADEL send the user to authenticate. - attr_accessor :authorization_endpoint - - # The endpoint where ZITADEL can get the token. - attr_accessor :token_endpoint - - # The endpoint where ZITADEL can get the user information. - attr_accessor :user_endpoint - - # The scopes requested by ZITADEL during the request on the identity provider. - attr_accessor :scopes - - # Defines how the attribute is called where ZITADEL can get the id of the user. - attr_accessor :id_attribute + class BetaSessionServiceOTPFactor + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :verified_at # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'client_id' => :'clientId', - :'authorization_endpoint' => :'authorizationEndpoint', - :'token_endpoint' => :'tokenEndpoint', - :'user_endpoint' => :'userEndpoint', - :'scopes' => :'scopes', - :'id_attribute' => :'idAttribute' + :'verified_at' => :'verifiedAt' } end @@ -58,12 +38,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'client_id' => :'String', - :'authorization_endpoint' => :'String', - :'token_endpoint' => :'String', - :'user_endpoint' => :'String', - :'scopes' => :'Array', - :'id_attribute' => :'String' + :'verified_at' => :'Time' } end @@ -78,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceOAuthConfig` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceOTPFactor` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -86,35 +61,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceOAuthConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceOTPFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'authorization_endpoint') - self.authorization_endpoint = attributes[:'authorization_endpoint'] - end - - if attributes.key?(:'token_endpoint') - self.token_endpoint = attributes[:'token_endpoint'] - end - - if attributes.key?(:'user_endpoint') - self.user_endpoint = attributes[:'user_endpoint'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - - if attributes.key?(:'id_attribute') - self.id_attribute = attributes[:'id_attribute'] + if attributes.key?(:'verified_at') + self.verified_at = attributes[:'verified_at'] end end @@ -138,12 +91,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - client_id == o.client_id && - authorization_endpoint == o.authorization_endpoint && - token_endpoint == o.token_endpoint && - user_endpoint == o.user_endpoint && - scopes == o.scopes && - id_attribute == o.id_attribute + verified_at == o.verified_at end # @see the `==` method @@ -155,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [client_id, authorization_endpoint, token_endpoint, user_endpoint, scopes, id_attribute].hash + [verified_at].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/session_service_request_challenges_o_t_p_s_m_s.rb b/lib/zitadel/client/models/beta_session_service_o_t_p_s_m_s.rb similarity index 95% rename from lib/zitadel/client/models/session_service_request_challenges_o_t_p_s_m_s.rb rename to lib/zitadel/client/models/beta_session_service_o_t_p_s_m_s.rb index 3ff6f216..2959ed4f 100644 --- a/lib/zitadel/client/models/session_service_request_challenges_o_t_p_s_m_s.rb +++ b/lib/zitadel/client/models/beta_session_service_o_t_p_s_m_s.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class SessionServiceRequestChallengesOTPSMS + class BetaSessionServiceOTPSMS attr_accessor :return_code # Attribute mapping from ruby-style variable name to JSON key. @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceRequestChallengesOTPSMS` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceOTPSMS` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +60,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceRequestChallengesOTPSMS`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceOTPSMS`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/beta_session_service_otp_email.rb b/lib/zitadel/client/models/beta_session_service_otp_email.rb new file mode 100644 index 00000000..049e1382 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_otp_email.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaSessionServiceOTPEmail + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode', + :'SendCode' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/action_service_create_target_request.rb b/lib/zitadel/client/models/beta_session_service_password_factor.rb similarity index 61% rename from lib/zitadel/client/models/action_service_create_target_request.rb rename to lib/zitadel/client/models/beta_session_service_password_factor.rb index d546bb8c..9361de46 100644 --- a/lib/zitadel/client/models/action_service_create_target_request.rb +++ b/lib/zitadel/client/models/beta_session_service_password_factor.rb @@ -14,29 +14,14 @@ require 'time' module Zitadel::Client::Models - class ActionServiceCreateTargetRequest - attr_accessor :name - - attr_accessor :rest_webhook - - attr_accessor :rest_call - - attr_accessor :rest_async - - # Timeout defines the duration until ZITADEL cancels the execution. If the target doesn't respond before this timeout expires, then the connection is closed and the action fails. Depending on the target type and possible setting on `interrupt_on_error` following targets will not be called. In case of a `rest_async` target only this specific target will fail, without any influence on other targets of the same execution. - attr_accessor :timeout - - attr_accessor :endpoint + class BetaSessionServicePasswordFactor + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :verified_at # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'name' => :'name', - :'rest_webhook' => :'restWebhook', - :'rest_call' => :'restCall', - :'rest_async' => :'restAsync', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint' + :'verified_at' => :'verifiedAt' } end @@ -53,12 +38,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'name' => :'String', - :'rest_webhook' => :'ActionServiceBetaRESTWebhook', - :'rest_call' => :'ActionServiceBetaRESTCall', - :'rest_async' => :'Object', - :'timeout' => :'String', - :'endpoint' => :'String' + :'verified_at' => :'Time' } end @@ -73,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceCreateTargetRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServicePasswordFactor` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -81,33 +61,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceCreateTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServicePasswordFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] + if attributes.key?(:'verified_at') + self.verified_at = attributes[:'verified_at'] end end @@ -116,22 +76,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@name.nil? && @name.to_s.length > 1000 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 1000.') - end - - if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - - if !@endpoint.nil? && @endpoint.to_s.length > 1000 - invalid_properties.push('invalid value for "endpoint", the character length must be smaller than or equal to 1000.') - end - - if !@endpoint.nil? && @endpoint.to_s.length < 1 - invalid_properties.push('invalid value for "endpoint", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -139,60 +83,15 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@name.nil? && @name.to_s.length > 1000 - return false if !@name.nil? && @name.to_s.length < 1 - return false if !@endpoint.nil? && @endpoint.to_s.length > 1000 - return false if !@endpoint.nil? && @endpoint.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length > 1000 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 1000.' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - @name = name - end - - # Custom attribute writer method with validation - # @param [Object] endpoint Value to be assigned - def endpoint=(endpoint) - if endpoint.nil? - fail ArgumentError, 'endpoint cannot be nil' - end - - if endpoint.to_s.length > 1000 - fail ArgumentError, 'invalid value for "endpoint", the character length must be smaller than or equal to 1000.' - end - - if endpoint.to_s.length < 1 - fail ArgumentError, 'invalid value for "endpoint", the character length must be great than or equal to 1.' - end - - @endpoint = endpoint - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - name == o.name && - rest_webhook == o.rest_webhook && - rest_call == o.rest_call && - rest_async == o.rest_async && - timeout == o.timeout && - endpoint == o.endpoint + verified_at == o.verified_at end # @see the `==` method @@ -204,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, rest_webhook, rest_call, rest_async, timeout, endpoint].hash + [verified_at].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_request_challenges.rb b/lib/zitadel/client/models/beta_session_service_request_challenges.rb new file mode 100644 index 00000000..fd2c12f7 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_request_challenges.rb @@ -0,0 +1,248 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceRequestChallenges + attr_accessor :web_auth_n + + attr_accessor :otp_sms + + attr_accessor :otp_email + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'web_auth_n' => :'webAuthN', + :'otp_sms' => :'otpSms', + :'otp_email' => :'otpEmail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'web_auth_n' => :'BetaSessionServiceWebAuthN', + :'otp_sms' => :'BetaSessionServiceOTPSMS', + :'otp_email' => :'BetaSessionServiceOTPEmail' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceRequestChallenges` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceRequestChallenges`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'web_auth_n') + self.web_auth_n = attributes[:'web_auth_n'] + end + + if attributes.key?(:'otp_sms') + self.otp_sms = attributes[:'otp_sms'] + end + + if attributes.key?(:'otp_email') + self.otp_email = attributes[:'otp_email'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + web_auth_n == o.web_auth_n && + otp_sms == o.otp_sms && + otp_email == o.otp_email + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [web_auth_n, otp_sms, otp_email].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_search_query.rb b/lib/zitadel/client/models/beta_session_service_search_query.rb new file mode 100644 index 00000000..fce2694e --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_search_query.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaSessionServiceSearchQuery + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CreationDateQuery', + :'IdsQuery', + :'UserIdQuery' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_session_service_session.rb b/lib/zitadel/client/models/beta_session_service_session.rb new file mode 100644 index 00000000..e726cf59 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_session.rb @@ -0,0 +1,299 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceSession + attr_accessor :id + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + attr_accessor :sequence + + attr_accessor :factors + + attr_accessor :metadata + + attr_accessor :user_agent + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :expiration_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'creation_date' => :'creationDate', + :'change_date' => :'changeDate', + :'sequence' => :'sequence', + :'factors' => :'factors', + :'metadata' => :'metadata', + :'user_agent' => :'userAgent', + :'expiration_date' => :'expirationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'creation_date' => :'Time', + :'change_date' => :'Time', + :'sequence' => :'Object', + :'factors' => :'BetaSessionServiceFactors', + :'metadata' => :'Hash', + :'user_agent' => :'BetaSessionServiceUserAgent', + :'expiration_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'sequence', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceSession` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'sequence') + self.sequence = attributes[:'sequence'] + end + + if attributes.key?(:'factors') + self.factors = attributes[:'factors'] + end + + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'user_agent') + self.user_agent = attributes[:'user_agent'] + end + + if attributes.key?(:'expiration_date') + self.expiration_date = attributes[:'expiration_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + creation_date == o.creation_date && + change_date == o.change_date && + sequence == o.sequence && + factors == o.factors && + metadata == o.metadata && + user_agent == o.user_agent && + expiration_date == o.expiration_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, creation_date, change_date, sequence, factors, metadata, user_agent, expiration_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_notification_type.rb b/lib/zitadel/client/models/beta_session_service_session_field_name.rb similarity index 66% rename from lib/zitadel/client/models/user_service_notification_type.rb rename to lib/zitadel/client/models/beta_session_service_session_field_name.rb index f09b9130..44f37ca9 100644 --- a/lib/zitadel/client/models/user_service_notification_type.rb +++ b/lib/zitadel/client/models/beta_session_service_session_field_name.rb @@ -14,13 +14,12 @@ require 'time' module Zitadel::Client::Models - class UserServiceNotificationType - NOTIFICATION_TYPE_UNSPECIFIED = "NOTIFICATION_TYPE_Unspecified".freeze - NOTIFICATION_TYPE_EMAIL = "NOTIFICATION_TYPE_Email".freeze - NOTIFICATION_TYPE_SMS = "NOTIFICATION_TYPE_SMS".freeze + class BetaSessionServiceSessionFieldName + SESSION_FIELD_NAME_UNSPECIFIED = "SESSION_FIELD_NAME_UNSPECIFIED".freeze + SESSION_FIELD_NAME_CREATION_DATE = "SESSION_FIELD_NAME_CREATION_DATE".freeze def self.all_vars - @all_vars ||= [NOTIFICATION_TYPE_UNSPECIFIED, NOTIFICATION_TYPE_EMAIL, NOTIFICATION_TYPE_SMS].freeze + @all_vars ||= [SESSION_FIELD_NAME_UNSPECIFIED, SESSION_FIELD_NAME_CREATION_DATE].freeze end # Builds the enum from string @@ -34,8 +33,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if UserServiceNotificationType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceNotificationType" + return value if BetaSessionServiceSessionFieldName.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSessionServiceSessionFieldName" end end diff --git a/lib/zitadel/client/models/o_i_d_c_service_session.rb b/lib/zitadel/client/models/beta_session_service_set_session_request.rb similarity index 66% rename from lib/zitadel/client/models/o_i_d_c_service_session.rb rename to lib/zitadel/client/models/beta_session_service_set_session_request.rb index 1493e4ed..11562761 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_session.rb +++ b/lib/zitadel/client/models/beta_session_service_set_session_request.rb @@ -14,18 +14,29 @@ require 'time' module Zitadel::Client::Models - class OIDCServiceSession - # ID of the session, used to login the user. Connects the session to the Auth Request. + class BetaSessionServiceSetSessionRequest attr_accessor :session_id - # Token to verify the session is valid attr_accessor :session_token + attr_accessor :checks + + attr_accessor :metadata + + attr_accessor :challenges + + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + attr_accessor :lifetime + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' + :'session_token' => :'sessionToken', + :'checks' => :'checks', + :'metadata' => :'metadata', + :'challenges' => :'challenges', + :'lifetime' => :'lifetime' } end @@ -43,7 +54,11 @@ def self.acceptable_attributes def self.openapi_types { :'session_id' => :'String', - :'session_token' => :'String' + :'session_token' => :'String', + :'checks' => :'BetaSessionServiceChecks', + :'metadata' => :'Hash', + :'challenges' => :'BetaSessionServiceRequestChallenges', + :'lifetime' => :'String' } end @@ -58,7 +73,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceSession` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceSetSessionRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,7 +81,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceSetSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -78,29 +93,31 @@ def initialize(attributes = {}) if attributes.key?(:'session_token') self.session_token = attributes[:'session_token'] end - end - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@session_id.nil? && @session_id.to_s.length > 200 - invalid_properties.push('invalid value for "session_id", the character length must be smaller than or equal to 200.') + if attributes.key?(:'checks') + self.checks = attributes[:'checks'] end - if !@session_id.nil? && @session_id.to_s.length < 1 - invalid_properties.push('invalid value for "session_id", the character length must be great than or equal to 1.') + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end end - if !@session_token.nil? && @session_token.to_s.length > 200 - invalid_properties.push('invalid value for "session_token", the character length must be smaller than or equal to 200.') + if attributes.key?(:'challenges') + self.challenges = attributes[:'challenges'] end - if !@session_token.nil? && @session_token.to_s.length < 1 - invalid_properties.push('invalid value for "session_token", the character length must be great than or equal to 1.') + if attributes.key?(:'lifetime') + self.lifetime = attributes[:'lifetime'] end + end + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new invalid_properties end @@ -108,56 +125,20 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@session_id.nil? && @session_id.to_s.length > 200 - return false if !@session_id.nil? && @session_id.to_s.length < 1 - return false if !@session_token.nil? && @session_token.to_s.length > 200 - return false if !@session_token.nil? && @session_token.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] session_id Value to be assigned - def session_id=(session_id) - if session_id.nil? - fail ArgumentError, 'session_id cannot be nil' - end - - if session_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "session_id", the character length must be smaller than or equal to 200.' - end - - if session_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "session_id", the character length must be great than or equal to 1.' - end - - @session_id = session_id - end - - # Custom attribute writer method with validation - # @param [Object] session_token Value to be assigned - def session_token=(session_token) - if session_token.nil? - fail ArgumentError, 'session_token cannot be nil' - end - - if session_token.to_s.length > 200 - fail ArgumentError, 'invalid value for "session_token", the character length must be smaller than or equal to 200.' - end - - if session_token.to_s.length < 1 - fail ArgumentError, 'invalid value for "session_token", the character length must be great than or equal to 1.' - end - - @session_token = session_token - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && session_id == o.session_id && - session_token == o.session_token + session_token == o.session_token && + checks == o.checks && + metadata == o.metadata && + challenges == o.challenges && + lifetime == o.lifetime end # @see the `==` method @@ -169,7 +150,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [session_id, session_token].hash + [session_id, session_token, checks, metadata, challenges, lifetime].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_set_session_response.rb b/lib/zitadel/client/models/beta_session_service_set_session_response.rb new file mode 100644 index 00000000..0cd77199 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_set_session_response.rb @@ -0,0 +1,248 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceSetSessionResponse + attr_accessor :details + + attr_accessor :session_token + + attr_accessor :challenges + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'session_token' => :'sessionToken', + :'challenges' => :'challenges' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSessionServiceDetails', + :'session_token' => :'String', + :'challenges' => :'BetaSessionServiceChallenges' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceSetSessionResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceSetSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'session_token') + self.session_token = attributes[:'session_token'] + end + + if attributes.key?(:'challenges') + self.challenges = attributes[:'challenges'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + session_token == o.session_token && + challenges == o.challenges + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, session_token, challenges].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_t_o_t_p_factor.rb b/lib/zitadel/client/models/beta_session_service_t_o_t_p_factor.rb new file mode 100644 index 00000000..3fcf2f50 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_t_o_t_p_factor.rb @@ -0,0 +1,231 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceTOTPFactor + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :verified_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'verified_at' => :'verifiedAt' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'verified_at' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceTOTPFactor` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceTOTPFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'verified_at') + self.verified_at = attributes[:'verified_at'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + verified_at == o.verified_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [verified_at].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_user_agent_query.rb b/lib/zitadel/client/models/beta_session_service_user_agent.rb similarity index 83% rename from lib/zitadel/client/models/session_service_user_agent_query.rb rename to lib/zitadel/client/models/beta_session_service_user_agent.rb index 921105d0..faac798f 100644 --- a/lib/zitadel/client/models/session_service_user_agent_query.rb +++ b/lib/zitadel/client/models/beta_session_service_user_agent.rb @@ -14,14 +14,22 @@ require 'time' module Zitadel::Client::Models - class SessionServiceUserAgentQuery - # Finger print id of the user agent used for the session. Set an empty fingerprint_id to use the user agent from the call. If the user agent is not available from the current token, an error will be returned. + class BetaSessionServiceUserAgent attr_accessor :fingerprint_id + attr_accessor :ip + + attr_accessor :description + + attr_accessor :header + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'fingerprint_id' => :'fingerprintId' + :'fingerprint_id' => :'fingerprintId', + :'ip' => :'ip', + :'description' => :'description', + :'header' => :'header' } end @@ -38,13 +46,19 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'fingerprint_id' => :'String' + :'fingerprint_id' => :'String', + :'ip' => :'String', + :'description' => :'String', + :'header' => :'Hash' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'fingerprint_id', + :'ip', + :'description', ]) end @@ -53,7 +67,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceUserAgentQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceUserAgent` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,7 +75,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceUserAgentQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceUserAgent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -69,6 +83,20 @@ def initialize(attributes = {}) if attributes.key?(:'fingerprint_id') self.fingerprint_id = attributes[:'fingerprint_id'] end + + if attributes.key?(:'ip') + self.ip = attributes[:'ip'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'header') + if (value = attributes[:'header']).is_a?(Hash) + self.header = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -76,10 +104,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@fingerprint_id.nil? && @fingerprint_id.to_s.length > 200 - invalid_properties.push('invalid value for "fingerprint_id", the character length must be smaller than or equal to 200.') - end - invalid_properties end @@ -87,30 +111,18 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@fingerprint_id.nil? && @fingerprint_id.to_s.length > 200 true end - # Custom attribute writer method with validation - # @param [Object] fingerprint_id Value to be assigned - def fingerprint_id=(fingerprint_id) - if fingerprint_id.nil? - fail ArgumentError, 'fingerprint_id cannot be nil' - end - - if fingerprint_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "fingerprint_id", the character length must be smaller than or equal to 200.' - end - - @fingerprint_id = fingerprint_id - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - fingerprint_id == o.fingerprint_id + fingerprint_id == o.fingerprint_id && + ip == o.ip && + description == o.description && + header == o.header end # @see the `==` method @@ -122,7 +134,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [fingerprint_id].hash + [fingerprint_id, ip, description, header].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_login_name_query.rb b/lib/zitadel/client/models/beta_session_service_user_factor.rb similarity index 57% rename from lib/zitadel/client/models/user_service_login_name_query.rb rename to lib/zitadel/client/models/beta_session_service_user_factor.rb index e6842159..04134735 100644 --- a/lib/zitadel/client/models/user_service_login_name_query.rb +++ b/lib/zitadel/client/models/beta_session_service_user_factor.rb @@ -14,39 +14,26 @@ require 'time' module Zitadel::Client::Models - # Query for users with a specific state. - class UserServiceLoginNameQuery + class BetaSessionServiceUserFactor + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :verified_at + + attr_accessor :id + attr_accessor :login_name - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end + attr_accessor :display_name - def valid?(value) - !value || allowable_values.include?(value) - end - end + attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'verified_at' => :'verifiedAt', + :'id' => :'id', :'login_name' => :'loginName', - :'method' => :'method' + :'display_name' => :'displayName', + :'organization_id' => :'organizationId' } end @@ -63,8 +50,11 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'verified_at' => :'Time', + :'id' => :'String', :'login_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' + :'display_name' => :'String', + :'organization_id' => :'String' } end @@ -79,7 +69,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLoginNameQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceUserFactor` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,21 +77,29 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLoginNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceUserFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } + if attributes.key?(:'verified_at') + self.verified_at = attributes[:'verified_at'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + if attributes.key?(:'login_name') self.login_name = attributes[:'login_name'] - else - self.login_name = nil end - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_QUERY_METHOD_EQUALS' + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] end end @@ -110,18 +108,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @login_name.nil? - invalid_properties.push('invalid value for "login_name", login_name cannot be nil.') - end - - if @login_name.to_s.length > 200 - invalid_properties.push('invalid value for "login_name", the character length must be smaller than or equal to 200.') - end - - if @login_name.to_s.length < 1 - invalid_properties.push('invalid value for "login_name", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -129,37 +115,19 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @login_name.nil? - return false if @login_name.to_s.length > 200 - return false if @login_name.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] login_name Value to be assigned - def login_name=(login_name) - if login_name.nil? - fail ArgumentError, 'login_name cannot be nil' - end - - if login_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "login_name", the character length must be smaller than or equal to 200.' - end - - if login_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "login_name", the character length must be great than or equal to 1.' - end - - @login_name = login_name - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + verified_at == o.verified_at && + id == o.id && login_name == o.login_name && - method == o.method + display_name == o.display_name && + organization_id == o.organization_id end # @see the `==` method @@ -171,7 +139,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [login_name, method].hash + [verified_at, id, login_name, display_name, organization_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_session_service_user_verification_requirement.rb b/lib/zitadel/client/models/beta_session_service_user_verification_requirement.rb new file mode 100644 index 00000000..0d346f9f --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_user_verification_requirement.rb @@ -0,0 +1,43 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSessionServiceUserVerificationRequirement + USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED".freeze + USER_VERIFICATION_REQUIREMENT_REQUIRED = "USER_VERIFICATION_REQUIREMENT_REQUIRED".freeze + USER_VERIFICATION_REQUIREMENT_PREFERRED = "USER_VERIFICATION_REQUIREMENT_PREFERRED".freeze + USER_VERIFICATION_REQUIREMENT_DISCOURAGED = "USER_VERIFICATION_REQUIREMENT_DISCOURAGED".freeze + + def self.all_vars + @all_vars ||= [USER_VERIFICATION_REQUIREMENT_UNSPECIFIED, USER_VERIFICATION_REQUIREMENT_REQUIRED, USER_VERIFICATION_REQUIREMENT_PREFERRED, USER_VERIFICATION_REQUIREMENT_DISCOURAGED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaSessionServiceUserVerificationRequirement.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSessionServiceUserVerificationRequirement" + end + end + +end diff --git a/lib/zitadel/client/models/beta_session_service_value.rb b/lib/zitadel/client/models/beta_session_service_value.rb new file mode 100644 index 00000000..fb75c32e --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_value.rb @@ -0,0 +1,114 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +# `Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of these variants. Absence of any variant indicates an error. The JSON representation for `Value` is JSON value. +module BetaSessionServiceValue + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'Boolean', + :'Float', + :'Hash', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/organization_service_organization_domain_query.rb b/lib/zitadel/client/models/beta_session_service_web_auth_n.rb similarity index 83% rename from lib/zitadel/client/models/organization_service_organization_domain_query.rb rename to lib/zitadel/client/models/beta_session_service_web_auth_n.rb index 8050b183..9d158385 100644 --- a/lib/zitadel/client/models/organization_service_organization_domain_query.rb +++ b/lib/zitadel/client/models/beta_session_service_web_auth_n.rb @@ -14,11 +14,10 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceOrganizationDomainQuery - # Domain used in organization, not necessary primary domain. + class BetaSessionServiceWebAuthN attr_accessor :domain - attr_accessor :method + attr_accessor :user_verification_requirement class EnumAttributeValidator attr_reader :datatype @@ -46,7 +45,7 @@ def valid?(value) def self.attribute_map { :'domain' => :'domain', - :'method' => :'method' + :'user_verification_requirement' => :'userVerificationRequirement' } end @@ -64,7 +63,7 @@ def self.acceptable_attributes def self.openapi_types { :'domain' => :'String', - :'method' => :'OrganizationServiceTextQueryMethod' + :'user_verification_requirement' => :'BetaSessionServiceUserVerificationRequirement' } end @@ -79,7 +78,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganizationDomainQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceWebAuthN` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,7 +86,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganizationDomainQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -98,10 +97,10 @@ def initialize(attributes = {}) self.domain = nil end - if attributes.key?(:'method') - self.method = attributes[:'method'] + if attributes.key?(:'user_verification_requirement') + self.user_verification_requirement = attributes[:'user_verification_requirement'] else - self.method = 'TEXT_QUERY_METHOD_EQUALS' + self.user_verification_requirement = nil end end @@ -114,12 +113,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "domain", domain cannot be nil.') end - if @domain.to_s.length > 200 - invalid_properties.push('invalid value for "domain", the character length must be smaller than or equal to 200.') - end - - if @domain.to_s.length < 1 - invalid_properties.push('invalid value for "domain", the character length must be great than or equal to 1.') + if @user_verification_requirement.nil? + invalid_properties.push('invalid value for "user_verification_requirement", user_verification_requirement cannot be nil.') end invalid_properties @@ -130,27 +125,28 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @domain.nil? - return false if @domain.to_s.length > 200 - return false if @domain.to_s.length < 1 + return false if @user_verification_requirement.nil? true end # Custom attribute writer method with validation - # @param [Object] domain Value to be assigned + # @param [String] domain Value to be assigned def domain=(domain) if domain.nil? fail ArgumentError, 'domain cannot be nil' end - if domain.to_s.length > 200 - fail ArgumentError, 'invalid value for "domain", the character length must be smaller than or equal to 200.' - end + @domain = domain + end - if domain.to_s.length < 1 - fail ArgumentError, 'invalid value for "domain", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [BetaSessionServiceUserVerificationRequirement] user_verification_requirement Value to be assigned + def user_verification_requirement=(user_verification_requirement) + if user_verification_requirement.nil? + fail ArgumentError, 'user_verification_requirement cannot be nil' end - @domain = domain + @user_verification_requirement = user_verification_requirement end # Checks equality by comparing each attribute. @@ -159,7 +155,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && domain == o.domain && - method == o.method + user_verification_requirement == o.user_verification_requirement end # @see the `==` method @@ -171,7 +167,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [domain, method].hash + [domain, user_verification_requirement].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/identity_provider_service_j_w_t_config.rb b/lib/zitadel/client/models/beta_session_service_web_auth_n_factor.rb similarity index 60% rename from lib/zitadel/client/models/identity_provider_service_j_w_t_config.rb rename to lib/zitadel/client/models/beta_session_service_web_auth_n_factor.rb index f5e795a3..41536188 100644 --- a/lib/zitadel/client/models/identity_provider_service_j_w_t_config.rb +++ b/lib/zitadel/client/models/beta_session_service_web_auth_n_factor.rb @@ -14,26 +14,17 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceJWTConfig - # The endpoint where the JWT can be extracted. - attr_accessor :jwt_endpoint + class BetaSessionServiceWebAuthNFactor + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :verified_at - # The issuer of the JWT (for validation). - attr_accessor :issuer - - # The endpoint to the key (JWK) which is used to sign the JWT with. - attr_accessor :keys_endpoint - - # The name of the header where the JWT is sent in, default is authorization. - attr_accessor :header_name + attr_accessor :user_verified # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'jwt_endpoint' => :'jwtEndpoint', - :'issuer' => :'issuer', - :'keys_endpoint' => :'keysEndpoint', - :'header_name' => :'headerName' + :'verified_at' => :'verifiedAt', + :'user_verified' => :'userVerified' } end @@ -50,10 +41,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'jwt_endpoint' => :'String', - :'issuer' => :'String', - :'keys_endpoint' => :'String', - :'header_name' => :'String' + :'verified_at' => :'Time', + :'user_verified' => :'Boolean' } end @@ -68,7 +57,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceJWTConfig` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceWebAuthNFactor` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -76,25 +65,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceJWTConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceWebAuthNFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'jwt_endpoint') - self.jwt_endpoint = attributes[:'jwt_endpoint'] - end - - if attributes.key?(:'issuer') - self.issuer = attributes[:'issuer'] - end - - if attributes.key?(:'keys_endpoint') - self.keys_endpoint = attributes[:'keys_endpoint'] + if attributes.key?(:'verified_at') + self.verified_at = attributes[:'verified_at'] end - if attributes.key?(:'header_name') - self.header_name = attributes[:'header_name'] + if attributes.key?(:'user_verified') + self.user_verified = attributes[:'user_verified'] end end @@ -118,10 +99,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - jwt_endpoint == o.jwt_endpoint && - issuer == o.issuer && - keys_endpoint == o.keys_endpoint && - header_name == o.header_name + verified_at == o.verified_at && + user_verified == o.user_verified end # @see the `==` method @@ -133,7 +112,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [jwt_endpoint, issuer, keys_endpoint, header_name].hash + [verified_at, user_verified].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/s_a_m_l_service_protobuf_any.rb b/lib/zitadel/client/models/beta_settings_service_any.rb similarity index 88% rename from lib/zitadel/client/models/s_a_m_l_service_protobuf_any.rb rename to lib/zitadel/client/models/beta_settings_service_any.rb index 7e8d2def..21bb01c3 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_protobuf_any.rb +++ b/lib/zitadel/client/models/beta_settings_service_any.rb @@ -14,13 +14,20 @@ require 'time' module Zitadel::Client::Models - class SAMLServiceProtobufAny + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class BetaSettingsServiceAny attr_accessor :type + attr_accessor :value + + attr_accessor :debug + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' } end @@ -37,7 +44,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' } end @@ -52,7 +61,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceAny` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +69,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -68,6 +77,16 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -90,7 +109,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + type == o.type && + value == o.value && + debug == o.debug end # @see the `==` method @@ -102,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [type, value, debug].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_send_password_reset_link.rb b/lib/zitadel/client/models/beta_settings_service_branding_settings.rb similarity index 74% rename from lib/zitadel/client/models/user_service_send_password_reset_link.rb rename to lib/zitadel/client/models/beta_settings_service_branding_settings.rb index b8a50d97..bdf27c88 100644 --- a/lib/zitadel/client/models/user_service_send_password_reset_link.rb +++ b/lib/zitadel/client/models/beta_settings_service_branding_settings.rb @@ -14,11 +14,21 @@ require 'time' module Zitadel::Client::Models - class UserServiceSendPasswordResetLink - attr_accessor :notification_type + class BetaSettingsServiceBrandingSettings + attr_accessor :light_theme - # Optionally set a url_template, which will be used in the password reset mail sent by ZITADEL to guide the user to your password change page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code - attr_accessor :url_template + attr_accessor :dark_theme + + attr_accessor :font_url + + # hides the org suffix on the login form if the scope \\\"urn:zitadel:iam:org:domain:primary:{domainname}\\\" is set + attr_accessor :hide_login_name_suffix + + attr_accessor :disable_watermark + + attr_accessor :resource_owner_type + + attr_accessor :theme_mode class EnumAttributeValidator attr_reader :datatype @@ -45,8 +55,13 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'notification_type' => :'notificationType', - :'url_template' => :'urlTemplate' + :'light_theme' => :'lightTheme', + :'dark_theme' => :'darkTheme', + :'font_url' => :'fontUrl', + :'hide_login_name_suffix' => :'hideLoginNameSuffix', + :'disable_watermark' => :'disableWatermark', + :'resource_owner_type' => :'resourceOwnerType', + :'theme_mode' => :'themeMode' } end @@ -63,8 +78,13 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'notification_type' => :'UserServiceNotificationType', - :'url_template' => :'String' + :'light_theme' => :'BetaSettingsServiceTheme', + :'dark_theme' => :'BetaSettingsServiceTheme', + :'font_url' => :'String', + :'hide_login_name_suffix' => :'Boolean', + :'disable_watermark' => :'Boolean', + :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType', + :'theme_mode' => :'BetaSettingsServiceThemeMode' } end @@ -79,7 +99,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendPasswordResetLink` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceBrandingSettings` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,19 +107,37 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendPasswordResetLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceBrandingSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'notification_type') - self.notification_type = attributes[:'notification_type'] - else - self.notification_type = 'NOTIFICATION_TYPE_Unspecified' + if attributes.key?(:'light_theme') + self.light_theme = attributes[:'light_theme'] + end + + if attributes.key?(:'dark_theme') + self.dark_theme = attributes[:'dark_theme'] end - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] + if attributes.key?(:'font_url') + self.font_url = attributes[:'font_url'] + end + + if attributes.key?(:'hide_login_name_suffix') + self.hide_login_name_suffix = attributes[:'hide_login_name_suffix'] + end + + if attributes.key?(:'disable_watermark') + self.disable_watermark = attributes[:'disable_watermark'] + end + + if attributes.key?(:'resource_owner_type') + self.resource_owner_type = attributes[:'resource_owner_type'] + end + + if attributes.key?(:'theme_mode') + self.theme_mode = attributes[:'theme_mode'] end end @@ -108,14 +146,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@url_template.nil? && @url_template.to_s.length > 200 - invalid_properties.push('invalid value for "url_template", the character length must be smaller than or equal to 200.') - end - - if !@url_template.nil? && @url_template.to_s.length < 1 - invalid_properties.push('invalid value for "url_template", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -123,36 +153,21 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@url_template.nil? && @url_template.to_s.length > 200 - return false if !@url_template.nil? && @url_template.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] url_template Value to be assigned - def url_template=(url_template) - if url_template.nil? - fail ArgumentError, 'url_template cannot be nil' - end - - if url_template.to_s.length > 200 - fail ArgumentError, 'invalid value for "url_template", the character length must be smaller than or equal to 200.' - end - - if url_template.to_s.length < 1 - fail ArgumentError, 'invalid value for "url_template", the character length must be great than or equal to 1.' - end - - @url_template = url_template - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - notification_type == o.notification_type && - url_template == o.url_template + light_theme == o.light_theme && + dark_theme == o.dark_theme && + font_url == o.font_url && + hide_login_name_suffix == o.hide_login_name_suffix && + disable_watermark == o.disable_watermark && + resource_owner_type == o.resource_owner_type && + theme_mode == o.theme_mode end # @see the `==` method @@ -164,7 +179,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [notification_type, url_template].hash + [light_theme, dark_theme, font_url, hide_login_name_suffix, disable_watermark, resource_owner_type, theme_mode].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_settings_service_connect_error.rb b/lib/zitadel/client/models/beta_settings_service_connect_error.rb new file mode 100644 index 00000000..bc50358a --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaSettingsServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'BetaSettingsServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_details.rb b/lib/zitadel/client/models/beta_settings_service_details.rb new file mode 100644 index 00000000..ea3ac5fa --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_details.rb @@ -0,0 +1,262 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceDetails + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + attr_accessor :sequence + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + # resource_owner is the organization or instance_id an object belongs to + attr_accessor :resource_owner + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'sequence' => :'sequence', + :'change_date' => :'changeDate', + :'resource_owner' => :'resourceOwner', + :'creation_date' => :'creationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'sequence' => :'Object', + :'change_date' => :'Time', + :'resource_owner' => :'String', + :'creation_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'sequence', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'sequence') + self.sequence = attributes[:'sequence'] + end + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'resource_owner') + self.resource_owner = attributes[:'resource_owner'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sequence == o.sequence && + change_date == o.change_date && + resource_owner == o.resource_owner && + creation_date == o.creation_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [sequence, change_date, resource_owner, creation_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_organization_name_query.rb b/lib/zitadel/client/models/beta_settings_service_domain_settings.rb similarity index 77% rename from lib/zitadel/client/models/organization_service_organization_name_query.rb rename to lib/zitadel/client/models/beta_settings_service_domain_settings.rb index cc7b0eda..e9534f2e 100644 --- a/lib/zitadel/client/models/organization_service_organization_name_query.rb +++ b/lib/zitadel/client/models/beta_settings_service_domain_settings.rb @@ -14,11 +14,14 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceOrganizationNameQuery - # Name of the organization. - attr_accessor :name + class BetaSettingsServiceDomainSettings + attr_accessor :login_name_includes_domain - attr_accessor :method + attr_accessor :require_org_domain_verification + + attr_accessor :smtp_sender_address_matches_instance_domain + + attr_accessor :resource_owner_type class EnumAttributeValidator attr_reader :datatype @@ -45,8 +48,10 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'name' => :'name', - :'method' => :'method' + :'login_name_includes_domain' => :'loginNameIncludesDomain', + :'require_org_domain_verification' => :'requireOrgDomainVerification', + :'smtp_sender_address_matches_instance_domain' => :'smtpSenderAddressMatchesInstanceDomain', + :'resource_owner_type' => :'resourceOwnerType' } end @@ -63,8 +68,10 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'name' => :'String', - :'method' => :'OrganizationServiceTextQueryMethod' + :'login_name_includes_domain' => :'Boolean', + :'require_org_domain_verification' => :'Boolean', + :'smtp_sender_address_matches_instance_domain' => :'Boolean', + :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType' } end @@ -79,7 +86,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganizationNameQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceDomainSettings` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,21 +94,25 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganizationNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceDomainSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'name') - self.name = attributes[:'name'] - else - self.name = nil + if attributes.key?(:'login_name_includes_domain') + self.login_name_includes_domain = attributes[:'login_name_includes_domain'] + end + + if attributes.key?(:'require_org_domain_verification') + self.require_org_domain_verification = attributes[:'require_org_domain_verification'] + end + + if attributes.key?(:'smtp_sender_address_matches_instance_domain') + self.smtp_sender_address_matches_instance_domain = attributes[:'smtp_sender_address_matches_instance_domain'] end - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_QUERY_METHOD_EQUALS' + if attributes.key?(:'resource_owner_type') + self.resource_owner_type = attributes[:'resource_owner_type'] end end @@ -110,18 +121,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @name.to_s.length > 200 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.') - end - - if @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -129,37 +128,18 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @name.nil? - return false if @name.to_s.length > 200 - return false if @name.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length > 200 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - @name = name - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - name == o.name && - method == o.method + login_name_includes_domain == o.login_name_includes_domain && + require_org_domain_verification == o.require_org_domain_verification && + smtp_sender_address_matches_instance_domain == o.smtp_sender_address_matches_instance_domain && + resource_owner_type == o.resource_owner_type end # @see the `==` method @@ -171,7 +151,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, method].hash + [login_name_includes_domain, require_org_domain_verification, smtp_sender_address_matches_instance_domain, resource_owner_type].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rb b/lib/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rb new file mode 100644 index 00000000..48784730 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rb @@ -0,0 +1,241 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceEmbeddedIframeSettings + attr_accessor :enabled + + attr_accessor :allowed_origins + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enabled' => :'enabled', + :'allowed_origins' => :'allowedOrigins' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'enabled' => :'Boolean', + :'allowed_origins' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceEmbeddedIframeSettings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceEmbeddedIframeSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'allowed_origins') + if (value = attributes[:'allowed_origins']).is_a?(Array) + self.allowed_origins = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enabled == o.enabled && + allowed_origins == o.allowed_origins + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [enabled, allowed_origins].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rb b/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rb new file mode 100644 index 00000000..20341bed --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetActiveIdentityProvidersRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'BetaSettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetActiveIdentityProvidersRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetActiveIdentityProvidersRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rb b/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rb new file mode 100644 index 00000000..02207eee --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rb @@ -0,0 +1,241 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetActiveIdentityProvidersResponse + attr_accessor :details + + attr_accessor :identity_providers + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'identity_providers' => :'identityProviders' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceListDetails', + :'identity_providers' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetActiveIdentityProvidersResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetActiveIdentityProvidersResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'identity_providers') + if (value = attributes[:'identity_providers']).is_a?(Array) + self.identity_providers = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + identity_providers == o.identity_providers + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, identity_providers].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/web_key_service_protobuf_any.rb b/lib/zitadel/client/models/beta_settings_service_get_branding_settings_request.rb similarity index 92% rename from lib/zitadel/client/models/web_key_service_protobuf_any.rb rename to lib/zitadel/client/models/beta_settings_service_get_branding_settings_request.rb index d3264035..a6269ea2 100644 --- a/lib/zitadel/client/models/web_key_service_protobuf_any.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_branding_settings_request.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceProtobufAny - attr_accessor :type + class BetaSettingsServiceGetBrandingSettingsRequest + attr_accessor :ctx # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'ctx' => :'ctx' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'ctx' => :'BetaSettingsServiceRequestContext' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetBrandingSettingsRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetBrandingSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + ctx == o.ctx end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [ctx].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_settings_service_get_branding_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_branding_settings_response.rb new file mode 100644 index 00000000..a1aa9715 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_branding_settings_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetBrandingSettingsResponse + attr_accessor :details + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'settings' => :'settings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails', + :'settings' => :'BetaSettingsServiceBrandingSettings' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetBrandingSettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetBrandingSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, settings].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_domain_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_domain_settings_request.rb new file mode 100644 index 00000000..7a97a061 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_domain_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetDomainSettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'BetaSettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetDomainSettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetDomainSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_domain_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_domain_settings_response.rb new file mode 100644 index 00000000..2f7970f9 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_domain_settings_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetDomainSettingsResponse + attr_accessor :details + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'settings' => :'settings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails', + :'settings' => :'BetaSettingsServiceDomainSettings' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetDomainSettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetDomainSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, settings].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_general_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_general_settings_response.rb new file mode 100644 index 00000000..bcf782c7 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_general_settings_response.rb @@ -0,0 +1,250 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetGeneralSettingsResponse + attr_accessor :default_org_id + + attr_accessor :default_language + + attr_accessor :supported_languages + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'default_org_id' => :'defaultOrgId', + :'default_language' => :'defaultLanguage', + :'supported_languages' => :'supportedLanguages' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'default_org_id' => :'String', + :'default_language' => :'String', + :'supported_languages' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetGeneralSettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetGeneralSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'default_org_id') + self.default_org_id = attributes[:'default_org_id'] + end + + if attributes.key?(:'default_language') + self.default_language = attributes[:'default_language'] + end + + if attributes.key?(:'supported_languages') + if (value = attributes[:'supported_languages']).is_a?(Array) + self.supported_languages = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + default_org_id == o.default_org_id && + default_language == o.default_language && + supported_languages == o.supported_languages + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [default_org_id, default_language, supported_languages].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rb new file mode 100644 index 00000000..12c3fbf7 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetLegalAndSupportSettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'BetaSettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLegalAndSupportSettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLegalAndSupportSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rb new file mode 100644 index 00000000..7b9cc95f --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetLegalAndSupportSettingsResponse + attr_accessor :details + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'settings' => :'settings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails', + :'settings' => :'BetaSettingsServiceLegalAndSupportSettings' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLegalAndSupportSettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLegalAndSupportSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, settings].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rb new file mode 100644 index 00000000..d579d34b --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetLockoutSettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'BetaSettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLockoutSettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLockoutSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rb new file mode 100644 index 00000000..4256fcc6 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetLockoutSettingsResponse + attr_accessor :details + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'settings' => :'settings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails', + :'settings' => :'BetaSettingsServiceLockoutSettings' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLockoutSettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLockoutSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, settings].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_login_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_login_settings_request.rb new file mode 100644 index 00000000..c67e6118 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_login_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetLoginSettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'BetaSettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLoginSettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLoginSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_login_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_login_settings_response.rb new file mode 100644 index 00000000..c8614cfd --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_login_settings_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetLoginSettingsResponse + attr_accessor :details + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'settings' => :'settings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails', + :'settings' => :'BetaSettingsServiceLoginSettings' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLoginSettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLoginSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, settings].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rb new file mode 100644 index 00000000..a818ee50 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetPasswordComplexitySettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'BetaSettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordComplexitySettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordComplexitySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rb new file mode 100644 index 00000000..7e5c53fe --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetPasswordComplexitySettingsResponse + attr_accessor :details + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'settings' => :'settings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails', + :'settings' => :'BetaSettingsServicePasswordComplexitySettings' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordComplexitySettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordComplexitySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, settings].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rb new file mode 100644 index 00000000..78240089 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetPasswordExpirySettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'BetaSettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordExpirySettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordExpirySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rb new file mode 100644 index 00000000..33392641 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetPasswordExpirySettingsResponse + attr_accessor :details + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'settings' => :'settings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails', + :'settings' => :'BetaSettingsServicePasswordExpirySettings' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordExpirySettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordExpirySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, settings].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_get_security_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_security_settings_response.rb new file mode 100644 index 00000000..d168b597 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_get_security_settings_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceGetSecuritySettingsResponse + attr_accessor :details + + attr_accessor :settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'settings' => :'settings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails', + :'settings' => :'BetaSettingsServiceSecuritySettings' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetSecuritySettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetSecuritySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + settings == o.settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, settings].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_type_query.rb b/lib/zitadel/client/models/beta_settings_service_identity_provider.rb similarity index 90% rename from lib/zitadel/client/models/user_service_type_query.rb rename to lib/zitadel/client/models/beta_settings_service_identity_provider.rb index ba61c5b3..8c8c3caf 100644 --- a/lib/zitadel/client/models/user_service_type_query.rb +++ b/lib/zitadel/client/models/beta_settings_service_identity_provider.rb @@ -14,8 +14,11 @@ require 'time' module Zitadel::Client::Models - # Query for users with a specific type. - class UserServiceTypeQuery + class BetaSettingsServiceIdentityProvider + attr_accessor :id + + attr_accessor :name + attr_accessor :type class EnumAttributeValidator @@ -43,6 +46,8 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'id' => :'id', + :'name' => :'name', :'type' => :'type' } end @@ -60,7 +65,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'UserServiceType' + :'id' => :'String', + :'name' => :'String', + :'type' => :'BetaSettingsServiceIdentityProviderType' } end @@ -75,7 +82,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceTypeQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceIdentityProvider` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -83,15 +90,21 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceTypeQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceIdentityProvider`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] - else - self.type = 'TYPE_UNSPECIFIED' end end @@ -100,10 +113,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - invalid_properties end @@ -111,25 +120,16 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @type.nil? true end - # Custom attribute writer method with validation - # @param [Object] type Value to be assigned - def type=(type) - if type.nil? - fail ArgumentError, 'type cannot be nil' - end - - @type = type - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + id == o.id && + name == o.name && type == o.type end @@ -142,7 +142,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [id, name, type].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_settings_service_identity_provider_type.rb b/lib/zitadel/client/models/beta_settings_service_identity_provider_type.rb new file mode 100644 index 00000000..61b225c3 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_identity_provider_type.rb @@ -0,0 +1,51 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceIdentityProviderType + IDENTITY_PROVIDER_TYPE_UNSPECIFIED = "IDENTITY_PROVIDER_TYPE_UNSPECIFIED".freeze + IDENTITY_PROVIDER_TYPE_OIDC = "IDENTITY_PROVIDER_TYPE_OIDC".freeze + IDENTITY_PROVIDER_TYPE_JWT = "IDENTITY_PROVIDER_TYPE_JWT".freeze + IDENTITY_PROVIDER_TYPE_LDAP = "IDENTITY_PROVIDER_TYPE_LDAP".freeze + IDENTITY_PROVIDER_TYPE_OAUTH = "IDENTITY_PROVIDER_TYPE_OAUTH".freeze + IDENTITY_PROVIDER_TYPE_AZURE_AD = "IDENTITY_PROVIDER_TYPE_AZURE_AD".freeze + IDENTITY_PROVIDER_TYPE_GITHUB = "IDENTITY_PROVIDER_TYPE_GITHUB".freeze + IDENTITY_PROVIDER_TYPE_GITHUB_ES = "IDENTITY_PROVIDER_TYPE_GITHUB_ES".freeze + IDENTITY_PROVIDER_TYPE_GITLAB = "IDENTITY_PROVIDER_TYPE_GITLAB".freeze + IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = "IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED".freeze + IDENTITY_PROVIDER_TYPE_GOOGLE = "IDENTITY_PROVIDER_TYPE_GOOGLE".freeze + IDENTITY_PROVIDER_TYPE_SAML = "IDENTITY_PROVIDER_TYPE_SAML".freeze + + def self.all_vars + @all_vars ||= [IDENTITY_PROVIDER_TYPE_UNSPECIFIED, IDENTITY_PROVIDER_TYPE_OIDC, IDENTITY_PROVIDER_TYPE_JWT, IDENTITY_PROVIDER_TYPE_LDAP, IDENTITY_PROVIDER_TYPE_OAUTH, IDENTITY_PROVIDER_TYPE_AZURE_AD, IDENTITY_PROVIDER_TYPE_GITHUB, IDENTITY_PROVIDER_TYPE_GITHUB_ES, IDENTITY_PROVIDER_TYPE_GITLAB, IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED, IDENTITY_PROVIDER_TYPE_GOOGLE, IDENTITY_PROVIDER_TYPE_SAML].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaSettingsServiceIdentityProviderType.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceIdentityProviderType" + end + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_legal_and_support_settings.rb b/lib/zitadel/client/models/beta_settings_service_legal_and_support_settings.rb new file mode 100644 index 00000000..4dd53ca8 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_legal_and_support_settings.rb @@ -0,0 +1,315 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceLegalAndSupportSettings + attr_accessor :tos_link + + attr_accessor :privacy_policy_link + + attr_accessor :help_link + + attr_accessor :support_email + + attr_accessor :resource_owner_type + + attr_accessor :docs_link + + attr_accessor :custom_link + + attr_accessor :custom_link_text + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tos_link' => :'tosLink', + :'privacy_policy_link' => :'privacyPolicyLink', + :'help_link' => :'helpLink', + :'support_email' => :'supportEmail', + :'resource_owner_type' => :'resourceOwnerType', + :'docs_link' => :'docsLink', + :'custom_link' => :'customLink', + :'custom_link_text' => :'customLinkText' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'tos_link' => :'String', + :'privacy_policy_link' => :'String', + :'help_link' => :'String', + :'support_email' => :'String', + :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType', + :'docs_link' => :'String', + :'custom_link' => :'String', + :'custom_link_text' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceLegalAndSupportSettings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceLegalAndSupportSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tos_link') + self.tos_link = attributes[:'tos_link'] + end + + if attributes.key?(:'privacy_policy_link') + self.privacy_policy_link = attributes[:'privacy_policy_link'] + end + + if attributes.key?(:'help_link') + self.help_link = attributes[:'help_link'] + end + + if attributes.key?(:'support_email') + self.support_email = attributes[:'support_email'] + end + + if attributes.key?(:'resource_owner_type') + self.resource_owner_type = attributes[:'resource_owner_type'] + end + + if attributes.key?(:'docs_link') + self.docs_link = attributes[:'docs_link'] + end + + if attributes.key?(:'custom_link') + self.custom_link = attributes[:'custom_link'] + end + + if attributes.key?(:'custom_link_text') + self.custom_link_text = attributes[:'custom_link_text'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tos_link == o.tos_link && + privacy_policy_link == o.privacy_policy_link && + help_link == o.help_link && + support_email == o.support_email && + resource_owner_type == o.resource_owner_type && + docs_link == o.docs_link && + custom_link == o.custom_link && + custom_link_text == o.custom_link_text + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tos_link, privacy_policy_link, help_link, support_email, resource_owner_type, docs_link, custom_link, custom_link_text].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_organization_id_query.rb b/lib/zitadel/client/models/beta_settings_service_list_details.rb similarity index 58% rename from lib/zitadel/client/models/user_service_organization_id_query.rb rename to lib/zitadel/client/models/beta_settings_service_list_details.rb index f6d330f6..abdccd4e 100644 --- a/lib/zitadel/client/models/user_service_organization_id_query.rb +++ b/lib/zitadel/client/models/beta_settings_service_list_details.rb @@ -14,14 +14,20 @@ require 'time' module Zitadel::Client::Models - # Query for users under a specific organization as resource owner. - class UserServiceOrganizationIdQuery - attr_accessor :organization_id + class BetaSettingsServiceListDetails + attr_accessor :total_result + + attr_accessor :processed_sequence + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :timestamp # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'organization_id' => :'organizationId' + :'total_result' => :'totalResult', + :'processed_sequence' => :'processedSequence', + :'timestamp' => :'timestamp' } end @@ -38,13 +44,17 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'organization_id' => :'String' + :'total_result' => :'Object', + :'processed_sequence' => :'Object', + :'timestamp' => :'Time' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'total_result', + :'processed_sequence', ]) end @@ -53,7 +63,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceOrganizationIdQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceListDetails` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,15 +71,21 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceOrganizationIdQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - else - self.organization_id = nil + if attributes.key?(:'total_result') + self.total_result = attributes[:'total_result'] + end + + if attributes.key?(:'processed_sequence') + self.processed_sequence = attributes[:'processed_sequence'] + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] end end @@ -78,18 +94,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @organization_id.nil? - invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.') - end - - if @organization_id.to_s.length > 200 - invalid_properties.push('invalid value for "organization_id", the character length must be smaller than or equal to 200.') - end - - if @organization_id.to_s.length < 1 - invalid_properties.push('invalid value for "organization_id", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -97,36 +101,17 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @organization_id.nil? - return false if @organization_id.to_s.length > 200 - return false if @organization_id.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] organization_id Value to be assigned - def organization_id=(organization_id) - if organization_id.nil? - fail ArgumentError, 'organization_id cannot be nil' - end - - if organization_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "organization_id", the character length must be smaller than or equal to 200.' - end - - if organization_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "organization_id", the character length must be great than or equal to 1.' - end - - @organization_id = organization_id - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - organization_id == o.organization_id + total_result == o.total_result && + processed_sequence == o.processed_sequence && + timestamp == o.timestamp end # @see the `==` method @@ -138,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [organization_id].hash + [total_result, processed_sequence, timestamp].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_settings_service_lockout_settings.rb b/lib/zitadel/client/models/beta_settings_service_lockout_settings.rb new file mode 100644 index 00000000..a8d1adcd --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_lockout_settings.rb @@ -0,0 +1,272 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceLockoutSettings + attr_accessor :max_password_attempts + + attr_accessor :resource_owner_type + + attr_accessor :max_otp_attempts + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'max_password_attempts' => :'maxPasswordAttempts', + :'resource_owner_type' => :'resourceOwnerType', + :'max_otp_attempts' => :'maxOtpAttempts' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'max_password_attempts' => :'Object', + :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType', + :'max_otp_attempts' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'max_password_attempts', + :'max_otp_attempts' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceLockoutSettings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceLockoutSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'max_password_attempts') + self.max_password_attempts = attributes[:'max_password_attempts'] + end + + if attributes.key?(:'resource_owner_type') + self.resource_owner_type = attributes[:'resource_owner_type'] + end + + if attributes.key?(:'max_otp_attempts') + self.max_otp_attempts = attributes[:'max_otp_attempts'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + max_password_attempts == o.max_password_attempts && + resource_owner_type == o.resource_owner_type && + max_otp_attempts == o.max_otp_attempts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [max_password_attempts, resource_owner_type, max_otp_attempts].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_login_settings.rb b/lib/zitadel/client/models/beta_settings_service_login_settings.rb new file mode 100644 index 00000000..ef586907 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_login_settings.rb @@ -0,0 +1,433 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceLoginSettings + attr_accessor :allow_username_password + + attr_accessor :allow_register + + attr_accessor :allow_external_idp + + attr_accessor :force_mfa + + attr_accessor :passkeys_type + + attr_accessor :hide_password_reset + + attr_accessor :ignore_unknown_usernames + + attr_accessor :default_redirect_uri + + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + attr_accessor :password_check_lifetime + + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + attr_accessor :external_login_check_lifetime + + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + attr_accessor :mfa_init_skip_lifetime + + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + attr_accessor :second_factor_check_lifetime + + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + attr_accessor :multi_factor_check_lifetime + + attr_accessor :second_factors + + attr_accessor :multi_factors + + # If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the org domains and will redirect to the registration of that organization on success. + attr_accessor :allow_domain_discovery + + attr_accessor :disable_login_with_email + + attr_accessor :disable_login_with_phone + + attr_accessor :resource_owner_type + + attr_accessor :force_mfa_local_only + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'allow_username_password' => :'allowUsernamePassword', + :'allow_register' => :'allowRegister', + :'allow_external_idp' => :'allowExternalIdp', + :'force_mfa' => :'forceMfa', + :'passkeys_type' => :'passkeysType', + :'hide_password_reset' => :'hidePasswordReset', + :'ignore_unknown_usernames' => :'ignoreUnknownUsernames', + :'default_redirect_uri' => :'defaultRedirectUri', + :'password_check_lifetime' => :'passwordCheckLifetime', + :'external_login_check_lifetime' => :'externalLoginCheckLifetime', + :'mfa_init_skip_lifetime' => :'mfaInitSkipLifetime', + :'second_factor_check_lifetime' => :'secondFactorCheckLifetime', + :'multi_factor_check_lifetime' => :'multiFactorCheckLifetime', + :'second_factors' => :'secondFactors', + :'multi_factors' => :'multiFactors', + :'allow_domain_discovery' => :'allowDomainDiscovery', + :'disable_login_with_email' => :'disableLoginWithEmail', + :'disable_login_with_phone' => :'disableLoginWithPhone', + :'resource_owner_type' => :'resourceOwnerType', + :'force_mfa_local_only' => :'forceMfaLocalOnly' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'allow_username_password' => :'Boolean', + :'allow_register' => :'Boolean', + :'allow_external_idp' => :'Boolean', + :'force_mfa' => :'Boolean', + :'passkeys_type' => :'BetaSettingsServicePasskeysType', + :'hide_password_reset' => :'Boolean', + :'ignore_unknown_usernames' => :'Boolean', + :'default_redirect_uri' => :'String', + :'password_check_lifetime' => :'String', + :'external_login_check_lifetime' => :'String', + :'mfa_init_skip_lifetime' => :'String', + :'second_factor_check_lifetime' => :'String', + :'multi_factor_check_lifetime' => :'String', + :'second_factors' => :'Array', + :'multi_factors' => :'Array', + :'allow_domain_discovery' => :'Boolean', + :'disable_login_with_email' => :'Boolean', + :'disable_login_with_phone' => :'Boolean', + :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType', + :'force_mfa_local_only' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceLoginSettings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceLoginSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'allow_username_password') + self.allow_username_password = attributes[:'allow_username_password'] + end + + if attributes.key?(:'allow_register') + self.allow_register = attributes[:'allow_register'] + end + + if attributes.key?(:'allow_external_idp') + self.allow_external_idp = attributes[:'allow_external_idp'] + end + + if attributes.key?(:'force_mfa') + self.force_mfa = attributes[:'force_mfa'] + end + + if attributes.key?(:'passkeys_type') + self.passkeys_type = attributes[:'passkeys_type'] + end + + if attributes.key?(:'hide_password_reset') + self.hide_password_reset = attributes[:'hide_password_reset'] + end + + if attributes.key?(:'ignore_unknown_usernames') + self.ignore_unknown_usernames = attributes[:'ignore_unknown_usernames'] + end + + if attributes.key?(:'default_redirect_uri') + self.default_redirect_uri = attributes[:'default_redirect_uri'] + end + + if attributes.key?(:'password_check_lifetime') + self.password_check_lifetime = attributes[:'password_check_lifetime'] + end + + if attributes.key?(:'external_login_check_lifetime') + self.external_login_check_lifetime = attributes[:'external_login_check_lifetime'] + end + + if attributes.key?(:'mfa_init_skip_lifetime') + self.mfa_init_skip_lifetime = attributes[:'mfa_init_skip_lifetime'] + end + + if attributes.key?(:'second_factor_check_lifetime') + self.second_factor_check_lifetime = attributes[:'second_factor_check_lifetime'] + end + + if attributes.key?(:'multi_factor_check_lifetime') + self.multi_factor_check_lifetime = attributes[:'multi_factor_check_lifetime'] + end + + if attributes.key?(:'second_factors') + if (value = attributes[:'second_factors']).is_a?(Array) + self.second_factors = value + end + end + + if attributes.key?(:'multi_factors') + if (value = attributes[:'multi_factors']).is_a?(Array) + self.multi_factors = value + end + end + + if attributes.key?(:'allow_domain_discovery') + self.allow_domain_discovery = attributes[:'allow_domain_discovery'] + end + + if attributes.key?(:'disable_login_with_email') + self.disable_login_with_email = attributes[:'disable_login_with_email'] + end + + if attributes.key?(:'disable_login_with_phone') + self.disable_login_with_phone = attributes[:'disable_login_with_phone'] + end + + if attributes.key?(:'resource_owner_type') + self.resource_owner_type = attributes[:'resource_owner_type'] + end + + if attributes.key?(:'force_mfa_local_only') + self.force_mfa_local_only = attributes[:'force_mfa_local_only'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + allow_username_password == o.allow_username_password && + allow_register == o.allow_register && + allow_external_idp == o.allow_external_idp && + force_mfa == o.force_mfa && + passkeys_type == o.passkeys_type && + hide_password_reset == o.hide_password_reset && + ignore_unknown_usernames == o.ignore_unknown_usernames && + default_redirect_uri == o.default_redirect_uri && + password_check_lifetime == o.password_check_lifetime && + external_login_check_lifetime == o.external_login_check_lifetime && + mfa_init_skip_lifetime == o.mfa_init_skip_lifetime && + second_factor_check_lifetime == o.second_factor_check_lifetime && + multi_factor_check_lifetime == o.multi_factor_check_lifetime && + second_factors == o.second_factors && + multi_factors == o.multi_factors && + allow_domain_discovery == o.allow_domain_discovery && + disable_login_with_email == o.disable_login_with_email && + disable_login_with_phone == o.disable_login_with_phone && + resource_owner_type == o.resource_owner_type && + force_mfa_local_only == o.force_mfa_local_only + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [allow_username_password, allow_register, allow_external_idp, force_mfa, passkeys_type, hide_password_reset, ignore_unknown_usernames, default_redirect_uri, password_check_lifetime, external_login_check_lifetime, mfa_init_skip_lifetime, second_factor_check_lifetime, multi_factor_check_lifetime, second_factors, multi_factors, allow_domain_discovery, disable_login_with_email, disable_login_with_phone, resource_owner_type, force_mfa_local_only].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_multi_factor_type.rb b/lib/zitadel/client/models/beta_settings_service_multi_factor_type.rb new file mode 100644 index 00000000..3ee9884c --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_multi_factor_type.rb @@ -0,0 +1,41 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceMultiFactorType + MULTI_FACTOR_TYPE_UNSPECIFIED = "MULTI_FACTOR_TYPE_UNSPECIFIED".freeze + MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = "MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION".freeze + + def self.all_vars + @all_vars ||= [MULTI_FACTOR_TYPE_UNSPECIFIED, MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaSettingsServiceMultiFactorType.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceMultiFactorType" + end + end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_r_s_a_bits.rb b/lib/zitadel/client/models/beta_settings_service_passkeys_type.rb similarity index 68% rename from lib/zitadel/client/models/web_key_service_beta_r_s_a_bits.rb rename to lib/zitadel/client/models/beta_settings_service_passkeys_type.rb index 1bfe8682..3e80c008 100644 --- a/lib/zitadel/client/models/web_key_service_beta_r_s_a_bits.rb +++ b/lib/zitadel/client/models/beta_settings_service_passkeys_type.rb @@ -14,14 +14,12 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaRSABits - RSA_BITS_UNSPECIFIED = "RSA_BITS_UNSPECIFIED".freeze - RSA_BITS_2048 = "RSA_BITS_2048".freeze - RSA_BITS_3072 = "RSA_BITS_3072".freeze - RSA_BITS_4096 = "RSA_BITS_4096".freeze + class BetaSettingsServicePasskeysType + PASSKEYS_TYPE_NOT_ALLOWED = "PASSKEYS_TYPE_NOT_ALLOWED".freeze + PASSKEYS_TYPE_ALLOWED = "PASSKEYS_TYPE_ALLOWED".freeze def self.all_vars - @all_vars ||= [RSA_BITS_UNSPECIFIED, RSA_BITS_2048, RSA_BITS_3072, RSA_BITS_4096].freeze + @all_vars ||= [PASSKEYS_TYPE_NOT_ALLOWED, PASSKEYS_TYPE_ALLOWED].freeze end # Builds the enum from string @@ -35,8 +33,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if WebKeyServiceBetaRSABits.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaRSABits" + return value if BetaSettingsServicePasskeysType.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServicePasskeysType" end end diff --git a/lib/zitadel/client/models/user_service_first_name_query.rb b/lib/zitadel/client/models/beta_settings_service_password_complexity_settings.rb similarity index 76% rename from lib/zitadel/client/models/user_service_first_name_query.rb rename to lib/zitadel/client/models/beta_settings_service_password_complexity_settings.rb index a015372c..a00506bb 100644 --- a/lib/zitadel/client/models/user_service_first_name_query.rb +++ b/lib/zitadel/client/models/beta_settings_service_password_complexity_settings.rb @@ -14,11 +14,18 @@ require 'time' module Zitadel::Client::Models - # Query for users with a specific first name. - class UserServiceFirstNameQuery - attr_accessor :first_name + class BetaSettingsServicePasswordComplexitySettings + attr_accessor :min_length - attr_accessor :method + attr_accessor :requires_uppercase + + attr_accessor :requires_lowercase + + attr_accessor :requires_number + + attr_accessor :requires_symbol + + attr_accessor :resource_owner_type class EnumAttributeValidator attr_reader :datatype @@ -45,8 +52,12 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'first_name' => :'firstName', - :'method' => :'method' + :'min_length' => :'minLength', + :'requires_uppercase' => :'requiresUppercase', + :'requires_lowercase' => :'requiresLowercase', + :'requires_number' => :'requiresNumber', + :'requires_symbol' => :'requiresSymbol', + :'resource_owner_type' => :'resourceOwnerType' } end @@ -63,14 +74,19 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'first_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' + :'min_length' => :'Object', + :'requires_uppercase' => :'Boolean', + :'requires_lowercase' => :'Boolean', + :'requires_number' => :'Boolean', + :'requires_symbol' => :'Boolean', + :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'min_length', ]) end @@ -79,7 +95,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceFirstNameQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServicePasswordComplexitySettings` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,41 +103,41 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceFirstNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServicePasswordComplexitySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - else - self.first_name = nil + if attributes.key?(:'min_length') + self.min_length = attributes[:'min_length'] end - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_QUERY_METHOD_EQUALS' + if attributes.key?(:'requires_uppercase') + self.requires_uppercase = attributes[:'requires_uppercase'] end - end - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @first_name.nil? - invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') + if attributes.key?(:'requires_lowercase') + self.requires_lowercase = attributes[:'requires_lowercase'] end - if @first_name.to_s.length > 200 - invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 200.') + if attributes.key?(:'requires_number') + self.requires_number = attributes[:'requires_number'] end - if @first_name.to_s.length < 1 - invalid_properties.push('invalid value for "first_name", the character length must be great than or equal to 1.') + if attributes.key?(:'requires_symbol') + self.requires_symbol = attributes[:'requires_symbol'] end + if attributes.key?(:'resource_owner_type') + self.resource_owner_type = attributes[:'resource_owner_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new invalid_properties end @@ -129,37 +145,20 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @first_name.nil? - return false if @first_name.to_s.length > 200 - return false if @first_name.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] first_name Value to be assigned - def first_name=(first_name) - if first_name.nil? - fail ArgumentError, 'first_name cannot be nil' - end - - if first_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 200.' - end - - if first_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "first_name", the character length must be great than or equal to 1.' - end - - @first_name = first_name - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - first_name == o.first_name && - method == o.method + min_length == o.min_length && + requires_uppercase == o.requires_uppercase && + requires_lowercase == o.requires_lowercase && + requires_number == o.requires_number && + requires_symbol == o.requires_symbol && + resource_owner_type == o.resource_owner_type end # @see the `==` method @@ -171,7 +170,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [first_name, method].hash + [min_length, requires_uppercase, requires_lowercase, requires_number, requires_symbol, resource_owner_type].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_settings_service_password_expiry_settings.rb b/lib/zitadel/client/models/beta_settings_service_password_expiry_settings.rb new file mode 100644 index 00000000..a8ba07e5 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_password_expiry_settings.rb @@ -0,0 +1,274 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServicePasswordExpirySettings + # Amount of days after which a password will expire. The user will be forced to change the password on the following authentication. + attr_accessor :max_age_days + + # Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user. + attr_accessor :expire_warn_days + + attr_accessor :resource_owner_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'max_age_days' => :'maxAgeDays', + :'expire_warn_days' => :'expireWarnDays', + :'resource_owner_type' => :'resourceOwnerType' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'max_age_days' => :'Object', + :'expire_warn_days' => :'Object', + :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'max_age_days', + :'expire_warn_days', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServicePasswordExpirySettings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServicePasswordExpirySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'max_age_days') + self.max_age_days = attributes[:'max_age_days'] + end + + if attributes.key?(:'expire_warn_days') + self.expire_warn_days = attributes[:'expire_warn_days'] + end + + if attributes.key?(:'resource_owner_type') + self.resource_owner_type = attributes[:'resource_owner_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + max_age_days == o.max_age_days && + expire_warn_days == o.expire_warn_days && + resource_owner_type == o.resource_owner_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [max_age_days, expire_warn_days, resource_owner_type].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_request_context.rb b/lib/zitadel/client/models/beta_settings_service_request_context.rb new file mode 100644 index 00000000..b8dc8eac --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_request_context.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaSettingsServiceRequestContext + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Instance', + :'OrgId' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a_curve.rb b/lib/zitadel/client/models/beta_settings_service_resource_owner_type.rb similarity index 64% rename from lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a_curve.rb rename to lib/zitadel/client/models/beta_settings_service_resource_owner_type.rb index c43309f3..e8a2c0a8 100644 --- a/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a_curve.rb +++ b/lib/zitadel/client/models/beta_settings_service_resource_owner_type.rb @@ -14,14 +14,13 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaECDSACurve - ECDSA_CURVE_UNSPECIFIED = "ECDSA_CURVE_UNSPECIFIED".freeze - ECDSA_CURVE_P256 = "ECDSA_CURVE_P256".freeze - ECDSA_CURVE_P384 = "ECDSA_CURVE_P384".freeze - ECDSA_CURVE_P512 = "ECDSA_CURVE_P512".freeze + class BetaSettingsServiceResourceOwnerType + RESOURCE_OWNER_TYPE_UNSPECIFIED = "RESOURCE_OWNER_TYPE_UNSPECIFIED".freeze + RESOURCE_OWNER_TYPE_INSTANCE = "RESOURCE_OWNER_TYPE_INSTANCE".freeze + RESOURCE_OWNER_TYPE_ORG = "RESOURCE_OWNER_TYPE_ORG".freeze def self.all_vars - @all_vars ||= [ECDSA_CURVE_UNSPECIFIED, ECDSA_CURVE_P256, ECDSA_CURVE_P384, ECDSA_CURVE_P512].freeze + @all_vars ||= [RESOURCE_OWNER_TYPE_UNSPECIFIED, RESOURCE_OWNER_TYPE_INSTANCE, RESOURCE_OWNER_TYPE_ORG].freeze end # Builds the enum from string @@ -35,8 +34,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if WebKeyServiceBetaECDSACurve.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaECDSACurve" + return value if BetaSettingsServiceResourceOwnerType.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceResourceOwnerType" end end diff --git a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_name_i_d_format.rb b/lib/zitadel/client/models/beta_settings_service_second_factor_type.rb similarity index 57% rename from lib/zitadel/client/models/identity_provider_service_s_a_m_l_name_i_d_format.rb rename to lib/zitadel/client/models/beta_settings_service_second_factor_type.rb index 71650a2f..9a27c168 100644 --- a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_name_i_d_format.rb +++ b/lib/zitadel/client/models/beta_settings_service_second_factor_type.rb @@ -14,14 +14,15 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceSAMLNameIDFormat - SAML_NAME_ID_FORMAT_UNSPECIFIED = "SAML_NAME_ID_FORMAT_UNSPECIFIED".freeze - SAML_NAME_ID_FORMAT_EMAIL_ADDRESS = "SAML_NAME_ID_FORMAT_EMAIL_ADDRESS".freeze - SAML_NAME_ID_FORMAT_PERSISTENT = "SAML_NAME_ID_FORMAT_PERSISTENT".freeze - SAML_NAME_ID_FORMAT_TRANSIENT = "SAML_NAME_ID_FORMAT_TRANSIENT".freeze + class BetaSettingsServiceSecondFactorType + SECOND_FACTOR_TYPE_UNSPECIFIED = "SECOND_FACTOR_TYPE_UNSPECIFIED".freeze + SECOND_FACTOR_TYPE_OTP = "SECOND_FACTOR_TYPE_OTP".freeze + SECOND_FACTOR_TYPE_U2_F = "SECOND_FACTOR_TYPE_U2F".freeze + SECOND_FACTOR_TYPE_OTP_EMAIL = "SECOND_FACTOR_TYPE_OTP_EMAIL".freeze + SECOND_FACTOR_TYPE_OTP_SMS = "SECOND_FACTOR_TYPE_OTP_SMS".freeze def self.all_vars - @all_vars ||= [SAML_NAME_ID_FORMAT_UNSPECIFIED, SAML_NAME_ID_FORMAT_EMAIL_ADDRESS, SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_TRANSIENT].freeze + @all_vars ||= [SECOND_FACTOR_TYPE_UNSPECIFIED, SECOND_FACTOR_TYPE_OTP, SECOND_FACTOR_TYPE_U2_F, SECOND_FACTOR_TYPE_OTP_EMAIL, SECOND_FACTOR_TYPE_OTP_SMS].freeze end # Builds the enum from string @@ -35,8 +36,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if IdentityProviderServiceSAMLNameIDFormat.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceSAMLNameIDFormat" + return value if BetaSettingsServiceSecondFactorType.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceSecondFactorType" end end diff --git a/lib/zitadel/client/models/identity_provider_service_git_lab_config.rb b/lib/zitadel/client/models/beta_settings_service_security_settings.rb similarity index 88% rename from lib/zitadel/client/models/identity_provider_service_git_lab_config.rb rename to lib/zitadel/client/models/beta_settings_service_security_settings.rb index 94abda3c..0ea61936 100644 --- a/lib/zitadel/client/models/identity_provider_service_git_lab_config.rb +++ b/lib/zitadel/client/models/beta_settings_service_security_settings.rb @@ -14,18 +14,16 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceGitLabConfig - # Client id of the GitLab application. - attr_accessor :client_id + class BetaSettingsServiceSecuritySettings + attr_accessor :embedded_iframe - # The scopes requested by ZITADEL during the request to GitLab. - attr_accessor :scopes + attr_accessor :enable_impersonation # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'client_id' => :'clientId', - :'scopes' => :'scopes' + :'embedded_iframe' => :'embeddedIframe', + :'enable_impersonation' => :'enableImpersonation' } end @@ -42,8 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'client_id' => :'String', - :'scopes' => :'Array' + :'embedded_iframe' => :'BetaSettingsServiceEmbeddedIframeSettings', + :'enable_impersonation' => :'Boolean' } end @@ -58,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGitLabConfig` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceSecuritySettings` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,19 +64,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGitLabConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceSecuritySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] + if attributes.key?(:'embedded_iframe') + self.embedded_iframe = attributes[:'embedded_iframe'] end - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end + if attributes.key?(:'enable_impersonation') + self.enable_impersonation = attributes[:'enable_impersonation'] end end @@ -102,8 +98,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - client_id == o.client_id && - scopes == o.scopes + embedded_iframe == o.embedded_iframe && + enable_impersonation == o.enable_impersonation end # @see the `==` method @@ -115,7 +111,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [client_id, scopes].hash + [embedded_iframe, enable_impersonation].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_settings_service_set_security_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_set_security_settings_request.rb new file mode 100644 index 00000000..7852a108 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_set_security_settings_request.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceSetSecuritySettingsRequest + attr_accessor :embedded_iframe + + attr_accessor :enable_impersonation + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'embedded_iframe' => :'embeddedIframe', + :'enable_impersonation' => :'enableImpersonation' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'embedded_iframe' => :'BetaSettingsServiceEmbeddedIframeSettings', + :'enable_impersonation' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceSetSecuritySettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceSetSecuritySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'embedded_iframe') + self.embedded_iframe = attributes[:'embedded_iframe'] + end + + if attributes.key?(:'enable_impersonation') + self.enable_impersonation = attributes[:'enable_impersonation'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + embedded_iframe == o.embedded_iframe && + enable_impersonation == o.enable_impersonation + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [embedded_iframe, enable_impersonation].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_set_security_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_set_security_settings_response.rb new file mode 100644 index 00000000..77cb5cb9 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_set_security_settings_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceSetSecuritySettingsResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaSettingsServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceSetSecuritySettingsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceSetSecuritySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_theme.rb b/lib/zitadel/client/models/beta_settings_service_theme.rb new file mode 100644 index 00000000..c500d119 --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_theme.rb @@ -0,0 +1,281 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceTheme + # hex value for primary color + attr_accessor :primary_color + + # hex value for background color + attr_accessor :background_color + + # hex value for warning color + attr_accessor :warn_color + + # hex value for font color + attr_accessor :font_color + + # url where the logo is served + attr_accessor :logo_url + + # url where the icon is served + attr_accessor :icon_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'primary_color' => :'primaryColor', + :'background_color' => :'backgroundColor', + :'warn_color' => :'warnColor', + :'font_color' => :'fontColor', + :'logo_url' => :'logoUrl', + :'icon_url' => :'iconUrl' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'primary_color' => :'String', + :'background_color' => :'String', + :'warn_color' => :'String', + :'font_color' => :'String', + :'logo_url' => :'String', + :'icon_url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceTheme` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceTheme`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'primary_color') + self.primary_color = attributes[:'primary_color'] + end + + if attributes.key?(:'background_color') + self.background_color = attributes[:'background_color'] + end + + if attributes.key?(:'warn_color') + self.warn_color = attributes[:'warn_color'] + end + + if attributes.key?(:'font_color') + self.font_color = attributes[:'font_color'] + end + + if attributes.key?(:'logo_url') + self.logo_url = attributes[:'logo_url'] + end + + if attributes.key?(:'icon_url') + self.icon_url = attributes[:'icon_url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + primary_color == o.primary_color && + background_color == o.background_color && + warn_color == o.warn_color && + font_color == o.font_color && + logo_url == o.logo_url && + icon_url == o.icon_url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [primary_color, background_color, warn_color, font_color, logo_url, icon_url].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_settings_service_theme_mode.rb b/lib/zitadel/client/models/beta_settings_service_theme_mode.rb new file mode 100644 index 00000000..3479273e --- /dev/null +++ b/lib/zitadel/client/models/beta_settings_service_theme_mode.rb @@ -0,0 +1,43 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaSettingsServiceThemeMode + THEME_MODE_UNSPECIFIED = "THEME_MODE_UNSPECIFIED".freeze + THEME_MODE_AUTO = "THEME_MODE_AUTO".freeze + THEME_MODE_LIGHT = "THEME_MODE_LIGHT".freeze + THEME_MODE_DARK = "THEME_MODE_DARK".freeze + + def self.all_vars + @all_vars ||= [THEME_MODE_UNSPECIFIED, THEME_MODE_AUTO, THEME_MODE_LIGHT, THEME_MODE_DARK].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaSettingsServiceThemeMode.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceThemeMode" + end + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_add_human_user_request.rb b/lib/zitadel/client/models/beta_user_service_add_human_user_request.rb new file mode 100644 index 00000000..a0fbe657 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_human_user_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceAddHumanUserRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'HashedPassword1', + :'Password1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_add_human_user_response.rb b/lib/zitadel/client/models/beta_user_service_add_human_user_response.rb new file mode 100644 index 00000000..9eb3ec2e --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_human_user_response.rb @@ -0,0 +1,259 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceAddHumanUserResponse + attr_accessor :user_id + + attr_accessor :details + + attr_accessor :email_code + + attr_accessor :phone_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'details' => :'details', + :'email_code' => :'emailCode', + :'phone_code' => :'phoneCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'details' => :'BetaUserServiceDetails', + :'email_code' => :'String', + :'phone_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'email_code', + :'phone_code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddHumanUserResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddHumanUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'email_code') + self.email_code = attributes[:'email_code'] + end + + if attributes.key?(:'phone_code') + self.phone_code = attributes[:'phone_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + details == o.details && + email_code == o.email_code && + phone_code == o.phone_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, details, email_code, phone_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_request.rb b/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_request.rb new file mode 100644 index 00000000..4d261d89 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_request.rb @@ -0,0 +1,256 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceAddIDPLinkRequest + attr_accessor :user_id + + attr_accessor :idp_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'idp_link' => :'idpLink' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'idp_link' => :'BetaUserServiceIDPLink' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddIDPLinkRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddIDPLinkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'idp_link') + self.idp_link = attributes[:'idp_link'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + idp_link == o.idp_link + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, idp_link].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_response.rb b/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_response.rb new file mode 100644 index 00000000..1d5785fb --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceAddIDPLinkResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddIDPLinkResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddIDPLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_request.rb b/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_request.rb new file mode 100644 index 00000000..19273b24 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceAddOTPEmailRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddOTPEmailRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddOTPEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_protobuf_any.rb b/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_response.rb similarity index 93% rename from lib/zitadel/client/models/identity_provider_service_protobuf_any.rb rename to lib/zitadel/client/models/beta_user_service_add_o_t_p_email_response.rb index 00c0d965..466c38bd 100644 --- a/lib/zitadel/client/models/identity_provider_service_protobuf_any.rb +++ b/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_response.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceProtobufAny - attr_accessor :type + class BetaUserServiceAddOTPEmailResponse + attr_accessor :details # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'details' => :'details' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'details' => :'BetaUserServiceDetails' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddOTPEmailResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddOTPEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + details == o.details end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [details].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_request.rb b/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_request.rb new file mode 100644 index 00000000..8c8ec44b --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceAddOTPSMSRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddOTPSMSRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddOTPSMSRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_response.rb b/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_response.rb new file mode 100644 index 00000000..b2c10e12 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceAddOTPSMSResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddOTPSMSResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddOTPSMSResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_any.rb b/lib/zitadel/client/models/beta_user_service_any.rb new file mode 100644 index 00000000..af76861b --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class BetaUserServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_authentication_method_type.rb b/lib/zitadel/client/models/beta_user_service_authentication_method_type.rb new file mode 100644 index 00000000..b72c16a4 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_authentication_method_type.rb @@ -0,0 +1,47 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceAuthenticationMethodType + AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = "AUTHENTICATION_METHOD_TYPE_UNSPECIFIED".freeze + AUTHENTICATION_METHOD_TYPE_PASSWORD = "AUTHENTICATION_METHOD_TYPE_PASSWORD".freeze + AUTHENTICATION_METHOD_TYPE_PASSKEY = "AUTHENTICATION_METHOD_TYPE_PASSKEY".freeze + AUTHENTICATION_METHOD_TYPE_IDP = "AUTHENTICATION_METHOD_TYPE_IDP".freeze + AUTHENTICATION_METHOD_TYPE_TOTP = "AUTHENTICATION_METHOD_TYPE_TOTP".freeze + AUTHENTICATION_METHOD_TYPE_U2_F = "AUTHENTICATION_METHOD_TYPE_U2F".freeze + AUTHENTICATION_METHOD_TYPE_OTP_SMS = "AUTHENTICATION_METHOD_TYPE_OTP_SMS".freeze + AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = "AUTHENTICATION_METHOD_TYPE_OTP_EMAIL".freeze + + def self.all_vars + @all_vars ||= [AUTHENTICATION_METHOD_TYPE_UNSPECIFIED, AUTHENTICATION_METHOD_TYPE_PASSWORD, AUTHENTICATION_METHOD_TYPE_PASSKEY, AUTHENTICATION_METHOD_TYPE_IDP, AUTHENTICATION_METHOD_TYPE_TOTP, AUTHENTICATION_METHOD_TYPE_U2_F, AUTHENTICATION_METHOD_TYPE_OTP_SMS, AUTHENTICATION_METHOD_TYPE_OTP_EMAIL].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaUserServiceAuthenticationMethodType.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceAuthenticationMethodType" + end + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_connect_error.rb b/lib/zitadel/client/models/beta_user_service_connect_error.rb new file mode 100644 index 00000000..5492573b --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaUserServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'BetaUserServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rb b/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rb new file mode 100644 index 00000000..ff8a3ac0 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceCreatePasskeyRegistrationLinkRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode9', + :'SendLink2' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/user_service_rpc_status.rb b/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rb similarity index 89% rename from lib/zitadel/client/models/user_service_rpc_status.rb rename to lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rb index c518c004..e307a941 100644 --- a/lib/zitadel/client/models/user_service_rpc_status.rb +++ b/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rb @@ -14,19 +14,16 @@ require 'time' module Zitadel::Client::Models - class UserServiceRpcStatus - attr_accessor :code - - attr_accessor :message - + class BetaUserServiceCreatePasskeyRegistrationLinkResponse attr_accessor :details + attr_accessor :code + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'details' => :'details', + :'code' => :'code' } end @@ -43,9 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'details' => :'BetaUserServiceDetails', + :'code' => :'BetaUserServicePasskeyRegistrationCode' } end @@ -60,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceCreatePasskeyRegistrationLinkResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,23 +64,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceCreatePasskeyRegistrationLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end + if attributes.key?(:'code') + self.code = attributes[:'code'] end end @@ -108,9 +98,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + details == o.details && + code == o.code end # @see the `==` method @@ -122,7 +111,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [details, code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant.rb b/lib/zitadel/client/models/beta_user_service_deactivate_user_request.rb similarity index 88% rename from lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant.rb rename to lib/zitadel/client/models/beta_user_service_deactivate_user_request.rb index a673b9e4..8e00d2b3 100644 --- a/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant.rb +++ b/lib/zitadel/client/models/beta_user_service_deactivate_user_request.rb @@ -14,16 +14,13 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceAzureADTenant - attr_accessor :tenant_type - - attr_accessor :tenant_id + class BetaUserServiceDeactivateUserRequest + attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'tenant_type' => :'tenantType', - :'tenant_id' => :'tenantId' + :'user_id' => :'userId' } end @@ -40,8 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'tenant_type' => :'IdentityProviderServiceAzureADTenantType', - :'tenant_id' => :'String' + :'user_id' => :'String' } end @@ -56,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceAzureADTenant` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDeactivateUserRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,19 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceAzureADTenant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDeactivateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'tenant_type') - self.tenant_type = attributes[:'tenant_type'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] else - self.tenant_type = 'AZURE_AD_TENANT_TYPE_COMMON' - end - - if attributes.key?(:'tenant_id') - self.tenant_id = attributes[:'tenant_id'] + self.user_id = nil end end @@ -85,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -92,16 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - tenant_type == o.tenant_type && - tenant_id == o.tenant_id + user_id == o.user_id end # @see the `==` method @@ -113,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [tenant_type, tenant_id].hash + [user_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/action_service_beta_set_execution_response.rb b/lib/zitadel/client/models/beta_user_service_deactivate_user_response.rb similarity index 93% rename from lib/zitadel/client/models/action_service_beta_set_execution_response.rb rename to lib/zitadel/client/models/beta_user_service_deactivate_user_response.rb index f1ce19ba..7c862eb3 100644 --- a/lib/zitadel/client/models/action_service_beta_set_execution_response.rb +++ b/lib/zitadel/client/models/beta_user_service_deactivate_user_response.rb @@ -14,14 +14,13 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaSetExecutionResponse - # The timestamp of the execution set. - attr_accessor :set_date + class BetaUserServiceDeactivateUserResponse + attr_accessor :details # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'set_date' => :'setDate' + :'details' => :'details' } end @@ -38,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'set_date' => :'Time' + :'details' => :'BetaUserServiceDetails' } end @@ -53,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaSetExecutionResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDeactivateUserResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaSetExecutionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDeactivateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'set_date') - self.set_date = attributes[:'set_date'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end end @@ -91,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - set_date == o.set_date + details == o.details end # @see the `==` method @@ -103,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [set_date].hash + [details].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_delete_user_request.rb b/lib/zitadel/client/models/beta_user_service_delete_user_request.rb new file mode 100644 index 00000000..fb7c1577 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_delete_user_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceDeleteUserRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDeleteUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDeleteUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_delete_user_response.rb b/lib/zitadel/client/models/beta_user_service_delete_user_response.rb new file mode 100644 index 00000000..d514e78f --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_delete_user_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceDeleteUserResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDeleteUserResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDeleteUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_details.rb b/lib/zitadel/client/models/beta_user_service_details.rb new file mode 100644 index 00000000..e88fd437 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_details.rb @@ -0,0 +1,262 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceDetails + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + attr_accessor :sequence + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :change_date + + # resource_owner is the organization or instance_id an object belongs to + attr_accessor :resource_owner + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :creation_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'sequence' => :'sequence', + :'change_date' => :'changeDate', + :'resource_owner' => :'resourceOwner', + :'creation_date' => :'creationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'sequence' => :'Object', + :'change_date' => :'Time', + :'resource_owner' => :'String', + :'creation_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'sequence', + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'sequence') + self.sequence = attributes[:'sequence'] + end + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_date'] + end + + if attributes.key?(:'resource_owner') + self.resource_owner = attributes[:'resource_owner'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sequence == o.sequence && + change_date == o.change_date && + resource_owner == o.resource_owner && + creation_date == o.creation_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [sequence, change_date, resource_owner, creation_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_gender.rb b/lib/zitadel/client/models/beta_user_service_gender.rb similarity index 89% rename from lib/zitadel/client/models/organization_service_gender.rb rename to lib/zitadel/client/models/beta_user_service_gender.rb index 935b3f19..12d755e4 100644 --- a/lib/zitadel/client/models/organization_service_gender.rb +++ b/lib/zitadel/client/models/beta_user_service_gender.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceGender + class BetaUserServiceGender GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED".freeze GENDER_FEMALE = "GENDER_FEMALE".freeze GENDER_MALE = "GENDER_MALE".freeze @@ -35,8 +35,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if OrganizationServiceGender.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceGender" + return value if BetaUserServiceGender.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceGender" end end diff --git a/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_request.rb b/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_request.rb new file mode 100644 index 00000000..9d0590ef --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceGetUserByIDRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceGetUserByIDRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceGetUserByIDRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_response.rb b/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_response.rb new file mode 100644 index 00000000..2d1b693c --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_response.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceGetUserByIDResponse + attr_accessor :details + + attr_accessor :user + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'user' => :'user' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails', + :'user' => :'BetaUserServiceUser' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceGetUserByIDResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceGetUserByIDResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + user == o.user + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, user].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_hashed_password.rb b/lib/zitadel/client/models/beta_user_service_hashed_password.rb similarity index 86% rename from lib/zitadel/client/models/organization_service_hashed_password.rb rename to lib/zitadel/client/models/beta_user_service_hashed_password.rb index 232c25ef..36731de6 100644 --- a/lib/zitadel/client/models/organization_service_hashed_password.rb +++ b/lib/zitadel/client/models/beta_user_service_hashed_password.rb @@ -14,8 +14,7 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceHashedPassword - # \"Encoded hash of a password in Modular Crypt Format: https://zitadel.com/docs/concepts/architecture/secrets#hashed-secrets\" + class BetaUserServiceHashedPassword attr_accessor :hash attr_accessor :change_required @@ -57,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceHashedPassword` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceHashedPassword` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -65,7 +64,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceHashedPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceHashedPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -90,14 +89,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "hash", hash cannot be nil.') end - if @hash.to_s.length > 200 - invalid_properties.push('invalid value for "hash", the character length must be smaller than or equal to 200.') - end - - if @hash.to_s.length < 1 - invalid_properties.push('invalid value for "hash", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -106,26 +97,16 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @hash.nil? - return false if @hash.to_s.length > 200 - return false if @hash.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] hash Value to be assigned + # @param [String] hash Value to be assigned def hash=(hash) if hash.nil? fail ArgumentError, 'hash cannot be nil' end - if hash.to_s.length > 200 - fail ArgumentError, 'invalid value for "hash", the character length must be smaller than or equal to 200.' - end - - if hash.to_s.length < 1 - fail ArgumentError, 'invalid value for "hash", the character length must be great than or equal to 1.' - end - @hash = hash end diff --git a/lib/zitadel/client/models/organization_service_add_organization_request_admin.rb b/lib/zitadel/client/models/beta_user_service_i_d_p_link.rb similarity index 89% rename from lib/zitadel/client/models/organization_service_add_organization_request_admin.rb rename to lib/zitadel/client/models/beta_user_service_i_d_p_link.rb index d923e441..483ef2df 100644 --- a/lib/zitadel/client/models/organization_service_add_organization_request_admin.rb +++ b/lib/zitadel/client/models/beta_user_service_i_d_p_link.rb @@ -14,19 +14,19 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceAddOrganizationRequestAdmin - attr_accessor :user_id + class BetaUserServiceIDPLink + attr_accessor :idp_id - attr_accessor :human + attr_accessor :user_id - attr_accessor :roles + attr_accessor :user_name # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'idp_id' => :'idpId', :'user_id' => :'userId', - :'human' => :'human', - :'roles' => :'roles' + :'user_name' => :'userName' } end @@ -43,9 +43,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'idp_id' => :'String', :'user_id' => :'String', - :'human' => :'OrganizationServiceAddHumanUserRequest', - :'roles' => :'Array' + :'user_name' => :'String' } end @@ -60,7 +60,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAddOrganizationRequestAdmin` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceIDPLink` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,23 +68,21 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAddOrganizationRequestAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceIDPLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] + if attributes.key?(:'idp_id') + self.idp_id = attributes[:'idp_id'] end - if attributes.key?(:'human') - self.human = attributes[:'human'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] end - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] end end @@ -108,9 +106,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + idp_id == o.idp_id && user_id == o.user_id && - human == o.human && - roles == o.roles + user_name == o.user_name end # @see the `==` method @@ -122,7 +120,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [user_id, human, roles].hash + [idp_id, user_id, user_name].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_idp_information.rb b/lib/zitadel/client/models/beta_user_service_idp_information.rb new file mode 100644 index 00000000..7f31e98d --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_idp_information.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceIDPInformation + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Ldap4', + :'Oauth2', + :'Saml2' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rb b/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rb new file mode 100644 index 00000000..871c3e00 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceListAuthenticationMethodTypesRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListAuthenticationMethodTypesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListAuthenticationMethodTypesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_rpc_status.rb b/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rb similarity index 87% rename from lib/zitadel/client/models/feature_service_rpc_status.rb rename to lib/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rb index 484bd7fb..762ff1bd 100644 --- a/lib/zitadel/client/models/feature_service_rpc_status.rb +++ b/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rb @@ -14,19 +14,16 @@ require 'time' module Zitadel::Client::Models - class FeatureServiceRpcStatus - attr_accessor :code - - attr_accessor :message - + class BetaUserServiceListAuthenticationMethodTypesResponse attr_accessor :details + attr_accessor :auth_method_types + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'details' => :'details', + :'auth_method_types' => :'authMethodTypes' } end @@ -43,9 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'details' => :'BetaUserServiceListDetails', + :'auth_method_types' => :'Array' } end @@ -60,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListAuthenticationMethodTypesResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,22 +64,18 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListAuthenticationMethodTypesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value + if attributes.key?(:'auth_method_types') + if (value = attributes[:'auth_method_types']).is_a?(Array) + self.auth_method_types = value end end end @@ -108,9 +100,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + details == o.details && + auth_method_types == o.auth_method_types end # @see the `==` method @@ -122,7 +113,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [details, auth_method_types].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/action_service_beta_condition.rb b/lib/zitadel/client/models/beta_user_service_list_details.rb similarity index 58% rename from lib/zitadel/client/models/action_service_beta_condition.rb rename to lib/zitadel/client/models/beta_user_service_list_details.rb index 00189813..6b85ff18 100644 --- a/lib/zitadel/client/models/action_service_beta_condition.rb +++ b/lib/zitadel/client/models/beta_user_service_list_details.rb @@ -14,22 +14,20 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaCondition - attr_accessor :request + class BetaUserServiceListDetails + attr_accessor :total_result - attr_accessor :response + attr_accessor :processed_sequence - attr_accessor :function - - attr_accessor :event + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :timestamp # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'request' => :'request', - :'response' => :'response', - :'function' => :'function', - :'event' => :'event' + :'total_result' => :'totalResult', + :'processed_sequence' => :'processedSequence', + :'timestamp' => :'timestamp' } end @@ -46,16 +44,17 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'request' => :'ActionServiceBetaRequestExecution', - :'response' => :'ActionServiceBetaResponseExecution', - :'function' => :'ActionServiceBetaFunctionExecution', - :'event' => :'ActionServiceBetaEventExecution' + :'total_result' => :'Object', + :'processed_sequence' => :'Object', + :'timestamp' => :'Time' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'total_result', + :'processed_sequence', ]) end @@ -64,7 +63,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaCondition` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListDetails` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -72,25 +71,21 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaCondition`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'request') - self.request = attributes[:'request'] - end - - if attributes.key?(:'response') - self.response = attributes[:'response'] + if attributes.key?(:'total_result') + self.total_result = attributes[:'total_result'] end - if attributes.key?(:'function') - self.function = attributes[:'function'] + if attributes.key?(:'processed_sequence') + self.processed_sequence = attributes[:'processed_sequence'] end - if attributes.key?(:'event') - self.event = attributes[:'event'] + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] end end @@ -114,10 +109,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - request == o.request && - response == o.response && - function == o.function && - event == o.event + total_result == o.total_result && + processed_sequence == o.processed_sequence && + timestamp == o.timestamp end # @see the `==` method @@ -129,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [request, response, function, event].hash + [total_result, processed_sequence, timestamp].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_in_user_i_d_query.rb b/lib/zitadel/client/models/beta_user_service_list_query.rb similarity index 89% rename from lib/zitadel/client/models/user_service_in_user_i_d_query.rb rename to lib/zitadel/client/models/beta_user_service_list_query.rb index f84c0588..59e2e88d 100644 --- a/lib/zitadel/client/models/user_service_in_user_i_d_query.rb +++ b/lib/zitadel/client/models/beta_user_service_list_query.rb @@ -14,15 +14,19 @@ require 'time' module Zitadel::Client::Models - # Query for users with ID in list of IDs. - class UserServiceInUserIDQuery - # the ids of the users to include - attr_accessor :user_ids + class BetaUserServiceListQuery + attr_accessor :offset + + attr_accessor :limit + + attr_accessor :asc # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'user_ids' => :'userIds' + :'offset' => :'offset', + :'limit' => :'limit', + :'asc' => :'asc' } end @@ -39,13 +43,16 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'user_ids' => :'Array' + :'offset' => :'Object', + :'limit' => :'Integer', + :'asc' => :'Boolean' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'offset', ]) end @@ -54,7 +61,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceInUserIDQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListQuery` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -62,15 +69,21 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceInUserIDQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'user_ids') - if (value = attributes[:'user_ids']).is_a?(Array) - self.user_ids = value - end + if attributes.key?(:'offset') + self.offset = attributes[:'offset'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'asc') + self.asc = attributes[:'asc'] end end @@ -94,7 +107,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - user_ids == o.user_ids + offset == o.offset && + limit == o.limit && + asc == o.asc end # @see the `==` method @@ -106,7 +121,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [user_ids].hash + [offset, limit, asc].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/session_service_creation_date_query.rb b/lib/zitadel/client/models/beta_user_service_list_users_request.rb similarity index 87% rename from lib/zitadel/client/models/session_service_creation_date_query.rb rename to lib/zitadel/client/models/beta_user_service_list_users_request.rb index d8a83f13..eb7eedab 100644 --- a/lib/zitadel/client/models/session_service_creation_date_query.rb +++ b/lib/zitadel/client/models/beta_user_service_list_users_request.rb @@ -14,10 +14,13 @@ require 'time' module Zitadel::Client::Models - class SessionServiceCreationDateQuery - attr_accessor :creation_date + class BetaUserServiceListUsersRequest + attr_accessor :query - attr_accessor :method + attr_accessor :sorting_column + + # criteria the client is looking for + attr_accessor :queries class EnumAttributeValidator attr_reader :datatype @@ -44,8 +47,9 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'creation_date' => :'creationDate', - :'method' => :'method' + :'query' => :'query', + :'sorting_column' => :'sortingColumn', + :'queries' => :'queries' } end @@ -62,8 +66,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'creation_date' => :'Time', - :'method' => :'SessionServiceTimestampQueryMethod' + :'query' => :'BetaUserServiceListQuery', + :'sorting_column' => :'BetaUserServiceUserFieldName', + :'queries' => :'Array' } end @@ -78,7 +83,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCreationDateQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListUsersRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -86,19 +91,23 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCreationDateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListUsersRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'sorting_column') + self.sorting_column = attributes[:'sorting_column'] end - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TIMESTAMP_QUERY_METHOD_EQUALS' + if attributes.key?(:'queries') + if (value = attributes[:'queries']).is_a?(Array) + self.queries = value + end end end @@ -122,8 +131,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - creation_date == o.creation_date && - method == o.method + query == o.query && + sorting_column == o.sorting_column && + queries == o.queries end # @see the `==` method @@ -135,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [creation_date, method].hash + [query, sorting_column, queries].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/o_i_d_c_service_authorization_error.rb b/lib/zitadel/client/models/beta_user_service_list_users_response.rb similarity index 86% rename from lib/zitadel/client/models/o_i_d_c_service_authorization_error.rb rename to lib/zitadel/client/models/beta_user_service_list_users_response.rb index 913656b9..8937eec1 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_authorization_error.rb +++ b/lib/zitadel/client/models/beta_user_service_list_users_response.rb @@ -14,12 +14,12 @@ require 'time' module Zitadel::Client::Models - class OIDCServiceAuthorizationError - attr_accessor :error + class BetaUserServiceListUsersResponse + attr_accessor :details - attr_accessor :error_description + attr_accessor :sorting_column - attr_accessor :error_uri + attr_accessor :result class EnumAttributeValidator attr_reader :datatype @@ -46,9 +46,9 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'error' => :'error', - :'error_description' => :'errorDescription', - :'error_uri' => :'errorUri' + :'details' => :'details', + :'sorting_column' => :'sortingColumn', + :'result' => :'result' } end @@ -65,9 +65,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'error' => :'OIDCServiceErrorReason', - :'error_description' => :'String', - :'error_uri' => :'String' + :'details' => :'BetaUserServiceListDetails', + :'sorting_column' => :'BetaUserServiceUserFieldName', + :'result' => :'Array' } end @@ -82,7 +82,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceAuthorizationError` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListUsersResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -90,23 +90,23 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceAuthorizationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListUsersResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'error') - self.error = attributes[:'error'] - else - self.error = 'ERROR_REASON_UNSPECIFIED' + if attributes.key?(:'details') + self.details = attributes[:'details'] end - if attributes.key?(:'error_description') - self.error_description = attributes[:'error_description'] + if attributes.key?(:'sorting_column') + self.sorting_column = attributes[:'sorting_column'] end - if attributes.key?(:'error_uri') - self.error_uri = attributes[:'error_uri'] + if attributes.key?(:'result') + if (value = attributes[:'result']).is_a?(Array) + self.result = value + end end end @@ -130,9 +130,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - error == o.error && - error_description == o.error_description && - error_uri == o.error_uri + details == o.details && + sorting_column == o.sorting_column && + result == o.result end # @see the `==` method @@ -144,7 +144,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [error, error_description, error_uri].hash + [details, sorting_column, result].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/organization_service_protobuf_any.rb b/lib/zitadel/client/models/beta_user_service_lock_user_request.rb similarity index 88% rename from lib/zitadel/client/models/organization_service_protobuf_any.rb rename to lib/zitadel/client/models/beta_user_service_lock_user_request.rb index 815a1efe..efc03c2c 100644 --- a/lib/zitadel/client/models/organization_service_protobuf_any.rb +++ b/lib/zitadel/client/models/beta_user_service_lock_user_request.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceProtobufAny - attr_accessor :type + class BetaUserServiceLockUserRequest + attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'user_id' => :'userId' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'user_id' => :'String' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceLockUserRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceLockUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil end end @@ -75,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -82,15 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + user_id == o.user_id end # @see the `==` method @@ -102,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [user_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_lock_user_response.rb b/lib/zitadel/client/models/beta_user_service_lock_user_response.rb new file mode 100644 index 00000000..199e66d4 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_lock_user_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceLockUserResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceLockUserResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceLockUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_organization.rb b/lib/zitadel/client/models/beta_user_service_organization.rb new file mode 100644 index 00000000..90b612d5 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_organization.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceOrganization + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'OrgDomain', + :'OrgId' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant_type.rb b/lib/zitadel/client/models/beta_user_service_passkey_authenticator.rb similarity index 62% rename from lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant_type.rb rename to lib/zitadel/client/models/beta_user_service_passkey_authenticator.rb index 571c49bd..ba1c8b72 100644 --- a/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant_type.rb +++ b/lib/zitadel/client/models/beta_user_service_passkey_authenticator.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceAzureADTenantType - AZURE_AD_TENANT_TYPE_COMMON = "AZURE_AD_TENANT_TYPE_COMMON".freeze - AZURE_AD_TENANT_TYPE_ORGANISATIONS = "AZURE_AD_TENANT_TYPE_ORGANISATIONS".freeze - AZURE_AD_TENANT_TYPE_CONSUMERS = "AZURE_AD_TENANT_TYPE_CONSUMERS".freeze + class BetaUserServicePasskeyAuthenticator + PASSKEY_AUTHENTICATOR_UNSPECIFIED = "PASSKEY_AUTHENTICATOR_UNSPECIFIED".freeze + PASSKEY_AUTHENTICATOR_PLATFORM = "PASSKEY_AUTHENTICATOR_PLATFORM".freeze + PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = "PASSKEY_AUTHENTICATOR_CROSS_PLATFORM".freeze def self.all_vars - @all_vars ||= [AZURE_AD_TENANT_TYPE_COMMON, AZURE_AD_TENANT_TYPE_ORGANISATIONS, AZURE_AD_TENANT_TYPE_CONSUMERS].freeze + @all_vars ||= [PASSKEY_AUTHENTICATOR_UNSPECIFIED, PASSKEY_AUTHENTICATOR_PLATFORM, PASSKEY_AUTHENTICATOR_CROSS_PLATFORM].freeze end # Builds the enum from string @@ -34,8 +34,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if IdentityProviderServiceAzureADTenantType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceAzureADTenantType" + return value if BetaUserServicePasskeyAuthenticator.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServicePasskeyAuthenticator" end end diff --git a/lib/zitadel/client/models/organization_service_organization_i_d_query.rb b/lib/zitadel/client/models/beta_user_service_passkey_registration_code.rb similarity index 86% rename from lib/zitadel/client/models/organization_service_organization_i_d_query.rb rename to lib/zitadel/client/models/beta_user_service_passkey_registration_code.rb index 68d26344..87343664 100644 --- a/lib/zitadel/client/models/organization_service_organization_i_d_query.rb +++ b/lib/zitadel/client/models/beta_user_service_passkey_registration_code.rb @@ -14,14 +14,16 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceOrganizationIDQuery - # Unique identifier of the organization. + class BetaUserServicePasskeyRegistrationCode attr_accessor :id + attr_accessor :code + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id' + :'id' => :'id', + :'code' => :'code' } end @@ -38,7 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'id' => :'String' + :'id' => :'String', + :'code' => :'String' } end @@ -53,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganizationIDQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServicePasskeyRegistrationCode` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,7 +64,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganizationIDQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServicePasskeyRegistrationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -71,6 +74,12 @@ def initialize(attributes = {}) else self.id = nil end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + else + self.code = nil + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -82,12 +91,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "id", id cannot be nil.') end - if @id.to_s.length > 200 - invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 200.') - end - - if @id.to_s.length < 1 - invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') end invalid_properties @@ -98,27 +103,28 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? - return false if @id.to_s.length > 200 - return false if @id.to_s.length < 1 + return false if @code.nil? true end # Custom attribute writer method with validation - # @param [Object] id Value to be assigned + # @param [String] id Value to be assigned def id=(id) if id.nil? fail ArgumentError, 'id cannot be nil' end - if id.to_s.length > 200 - fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 200.' - end + @id = id + end - if id.to_s.length < 1 - fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' end - @id = id + @code = code end # Checks equality by comparing each attribute. @@ -126,7 +132,8 @@ def id=(id) def ==(o) return true if self.equal?(o) self.class == o.class && - id == o.id + id == o.id && + code == o.code end # @see the `==` method @@ -138,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id].hash + [id, code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/organization_service_password.rb b/lib/zitadel/client/models/beta_user_service_password.rb similarity index 87% rename from lib/zitadel/client/models/organization_service_password.rb rename to lib/zitadel/client/models/beta_user_service_password.rb index a584ee61..404326ab 100644 --- a/lib/zitadel/client/models/organization_service_password.rb +++ b/lib/zitadel/client/models/beta_user_service_password.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class OrganizationServicePassword + class BetaUserServicePassword attr_accessor :password attr_accessor :change_required @@ -56,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServicePassword` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServicePassword` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,7 +64,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServicePassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServicePassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -89,14 +89,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "password", password cannot be nil.') end - if @password.to_s.length > 200 - invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 200.') - end - - if @password.to_s.length < 1 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -105,26 +97,16 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @password.nil? - return false if @password.to_s.length > 200 - return false if @password.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] password Value to be assigned + # @param [String] password Value to be assigned def password=(password) if password.nil? fail ArgumentError, 'password cannot be nil' end - if password.to_s.length > 200 - fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 200.' - end - - if password.to_s.length < 1 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.' - end - @password = password end diff --git a/lib/zitadel/client/models/beta_user_service_password_reset_request.rb b/lib/zitadel/client/models/beta_user_service_password_reset_request.rb new file mode 100644 index 00000000..898079e8 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_password_reset_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServicePasswordResetRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode10', + :'SendLink3' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_password_reset_response.rb b/lib/zitadel/client/models/beta_user_service_password_reset_response.rb new file mode 100644 index 00000000..0fe183ff --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_password_reset_response.rb @@ -0,0 +1,241 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServicePasswordResetResponse + attr_accessor :details + + # in case the medium was set to return_code, the code will be returned + attr_accessor :verification_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'verification_code' => :'verificationCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails', + :'verification_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'verification_code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServicePasswordResetResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServicePasswordResetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + verification_code == o.verification_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, verification_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_reactivate_user_request.rb b/lib/zitadel/client/models/beta_user_service_reactivate_user_request.rb new file mode 100644 index 00000000..0ece5207 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_reactivate_user_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceReactivateUserRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceReactivateUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceReactivateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_reactivate_user_response.rb b/lib/zitadel/client/models/beta_user_service_reactivate_user_response.rb new file mode 100644 index 00000000..fa166231 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_reactivate_user_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceReactivateUserResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceReactivateUserResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceReactivateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_target_name_filter.rb b/lib/zitadel/client/models/beta_user_service_register_passkey_request.rb similarity index 81% rename from lib/zitadel/client/models/action_service_beta_target_name_filter.rb rename to lib/zitadel/client/models/beta_user_service_register_passkey_request.rb index 3b6d0565..545814d7 100644 --- a/lib/zitadel/client/models/action_service_beta_target_name_filter.rb +++ b/lib/zitadel/client/models/beta_user_service_register_passkey_request.rb @@ -14,11 +14,14 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaTargetNameFilter - # Defines the name of the target to query for. - attr_accessor :target_name + class BetaUserServiceRegisterPasskeyRequest + attr_accessor :user_id - attr_accessor :method + attr_accessor :code + + attr_accessor :authenticator + + attr_accessor :domain class EnumAttributeValidator attr_reader :datatype @@ -45,8 +48,10 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'target_name' => :'targetName', - :'method' => :'method' + :'user_id' => :'userId', + :'code' => :'code', + :'authenticator' => :'authenticator', + :'domain' => :'domain' } end @@ -63,8 +68,10 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'target_name' => :'String', - :'method' => :'ActionServiceBetaTextFilterMethod' + :'user_id' => :'String', + :'code' => :'BetaUserServicePasskeyRegistrationCode', + :'authenticator' => :'BetaUserServicePasskeyAuthenticator', + :'domain' => :'String' } end @@ -79,7 +86,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaTargetNameFilter` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterPasskeyRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,19 +94,27 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaTargetNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterPasskeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'target_name') - self.target_name = attributes[:'target_name'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil end - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_FILTER_METHOD_EQUALS' + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'authenticator') + self.authenticator = attributes[:'authenticator'] + end + + if attributes.key?(:'domain') + self.domain = attributes[:'domain'] end end @@ -108,8 +123,8 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@target_name.nil? && @target_name.to_s.length > 200 - invalid_properties.push('invalid value for "target_name", the character length must be smaller than or equal to 200.') + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end invalid_properties @@ -119,22 +134,18 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@target_name.nil? && @target_name.to_s.length > 200 + return false if @user_id.nil? true end # Custom attribute writer method with validation - # @param [Object] target_name Value to be assigned - def target_name=(target_name) - if target_name.nil? - fail ArgumentError, 'target_name cannot be nil' - end - - if target_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "target_name", the character length must be smaller than or equal to 200.' + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' end - @target_name = target_name + @user_id = user_id end # Checks equality by comparing each attribute. @@ -142,8 +153,10 @@ def target_name=(target_name) def ==(o) return true if self.equal?(o) self.class == o.class && - target_name == o.target_name && - method == o.method + user_id == o.user_id && + code == o.code && + authenticator == o.authenticator && + domain == o.domain end # @see the `==` method @@ -155,7 +168,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [target_name, method].hash + [user_id, code, authenticator, domain].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_register_passkey_response.rb b/lib/zitadel/client/models/beta_user_service_register_passkey_response.rb new file mode 100644 index 00000000..891dca91 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_register_passkey_response.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRegisterPasskeyResponse + attr_accessor :details + + attr_accessor :passkey_id + + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + attr_accessor :public_key_credential_creation_options + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'passkey_id' => :'passkeyId', + :'public_key_credential_creation_options' => :'publicKeyCredentialCreationOptions' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails', + :'passkey_id' => :'String', + :'public_key_credential_creation_options' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterPasskeyResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterPasskeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'passkey_id') + self.passkey_id = attributes[:'passkey_id'] + end + + if attributes.key?(:'public_key_credential_creation_options') + if (value = attributes[:'public_key_credential_creation_options']).is_a?(Hash) + self.public_key_credential_creation_options = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + passkey_id == o.passkey_id && + public_key_credential_creation_options == o.public_key_credential_creation_options + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, passkey_id, public_key_credential_creation_options].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_request.rb b/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_request.rb new file mode 100644 index 00000000..fe54c502 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRegisterTOTPRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterTOTPRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterTOTPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_google_config.rb b/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_response.rb similarity index 88% rename from lib/zitadel/client/models/identity_provider_service_google_config.rb rename to lib/zitadel/client/models/beta_user_service_register_t_o_t_p_response.rb index 800843e9..38f318ef 100644 --- a/lib/zitadel/client/models/identity_provider_service_google_config.rb +++ b/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_response.rb @@ -14,18 +14,19 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceGoogleConfig - # Client id of the Google application. - attr_accessor :client_id + class BetaUserServiceRegisterTOTPResponse + attr_accessor :details - # The scopes requested by ZITADEL during the request to Google. - attr_accessor :scopes + attr_accessor :uri + + attr_accessor :secret # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'client_id' => :'clientId', - :'scopes' => :'scopes' + :'details' => :'details', + :'uri' => :'uri', + :'secret' => :'secret' } end @@ -42,8 +43,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'client_id' => :'String', - :'scopes' => :'Array' + :'details' => :'BetaUserServiceDetails', + :'uri' => :'String', + :'secret' => :'String' } end @@ -58,7 +60,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGoogleConfig` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterTOTPResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,19 +68,21 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGoogleConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterTOTPResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end + if attributes.key?(:'uri') + self.uri = attributes[:'uri'] + end + + if attributes.key?(:'secret') + self.secret = attributes[:'secret'] end end @@ -102,8 +106,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - client_id == o.client_id && - scopes == o.scopes + details == o.details && + uri == o.uri && + secret == o.secret end # @see the `==` method @@ -115,7 +120,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [client_id, scopes].hash + [details, uri, secret].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_register_u2_f_request.rb b/lib/zitadel/client/models/beta_user_service_register_u2_f_request.rb new file mode 100644 index 00000000..aaaee5cd --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_register_u2_f_request.rb @@ -0,0 +1,256 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRegisterU2FRequest + attr_accessor :user_id + + attr_accessor :domain + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'domain' => :'domain' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'domain' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterU2FRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterU2FRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'domain') + self.domain = attributes[:'domain'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + domain == o.domain + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, domain].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/s_a_m_l_service_create_response_response.rb b/lib/zitadel/client/models/beta_user_service_register_u2_f_response.rb similarity index 81% rename from lib/zitadel/client/models/s_a_m_l_service_create_response_response.rb rename to lib/zitadel/client/models/beta_user_service_register_u2_f_response.rb index c84d8c9f..b858d25a 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_create_response_response.rb +++ b/lib/zitadel/client/models/beta_user_service_register_u2_f_response.rb @@ -14,23 +14,20 @@ require 'time' module Zitadel::Client::Models - class SAMLServiceCreateResponseResponse + class BetaUserServiceRegisterU2FResponse attr_accessor :details - # URL including the Assertion Consumer Service where the user should be redirected or has to call per POST, depending on the binding. Contains details for the application to obtain the response on success, or error details on failure. Note that this field must be treated as credentials, as the contained SAMLResponse or code can be used on behalve of the user. - attr_accessor :url + attr_accessor :u2f_id - attr_accessor :redirect - - attr_accessor :post + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + attr_accessor :public_key_credential_creation_options # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'details' => :'details', - :'url' => :'url', - :'redirect' => :'redirect', - :'post' => :'post' + :'u2f_id' => :'u2fId', + :'public_key_credential_creation_options' => :'publicKeyCredentialCreationOptions' } end @@ -47,10 +44,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'details' => :'SAMLServiceDetails', - :'url' => :'String', - :'redirect' => :'Object', - :'post' => :'SAMLServicePostResponse' + :'details' => :'BetaUserServiceDetails', + :'u2f_id' => :'String', + :'public_key_credential_creation_options' => :'Hash' } end @@ -65,7 +61,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceCreateResponseResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterU2FResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -73,7 +69,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceCreateResponseResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterU2FResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -82,16 +78,14 @@ def initialize(attributes = {}) self.details = attributes[:'details'] end - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'redirect') - self.redirect = attributes[:'redirect'] + if attributes.key?(:'u2f_id') + self.u2f_id = attributes[:'u2f_id'] end - if attributes.key?(:'post') - self.post = attributes[:'post'] + if attributes.key?(:'public_key_credential_creation_options') + if (value = attributes[:'public_key_credential_creation_options']).is_a?(Hash) + self.public_key_credential_creation_options = value + end end end @@ -116,9 +110,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && details == o.details && - url == o.url && - redirect == o.redirect && - post == o.post + u2f_id == o.u2f_id && + public_key_credential_creation_options == o.public_key_credential_creation_options end # @see the `==` method @@ -130,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [details, url, redirect, post].hash + [details, u2f_id, public_key_credential_creation_options].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_request.rb b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_request.rb new file mode 100644 index 00000000..3423abd7 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRemoveOTPEmailRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveOTPEmailRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveOTPEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_response.rb b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_response.rb new file mode 100644 index 00000000..0c8b2757 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRemoveOTPEmailResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveOTPEmailResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveOTPEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_request.rb b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_request.rb new file mode 100644 index 00000000..471897c0 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRemoveOTPSMSRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveOTPSMSRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveOTPSMSRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_i_d_p_s_a_m_l_access_information.rb b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_response.rb similarity index 93% rename from lib/zitadel/client/models/user_service_i_d_p_s_a_m_l_access_information.rb rename to lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_response.rb index 6b6f1f67..12ecd647 100644 --- a/lib/zitadel/client/models/user_service_i_d_p_s_a_m_l_access_information.rb +++ b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_response.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class UserServiceIDPSAMLAccessInformation - attr_accessor :assertion + class BetaUserServiceRemoveOTPSMSResponse + attr_accessor :details # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'assertion' => :'assertion' + :'details' => :'details' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'assertion' => :'String' + :'details' => :'BetaUserServiceDetails' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPSAMLAccessInformation` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveOTPSMSResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPSAMLAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveOTPSMSResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'assertion') - self.assertion = attributes[:'assertion'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - assertion == o.assertion + details == o.details end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [assertion].hash + [details].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_remove_phone_request.rb b/lib/zitadel/client/models/beta_user_service_remove_phone_request.rb new file mode 100644 index 00000000..61ba1dca --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_phone_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRemovePhoneRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemovePhoneRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemovePhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_function_execution.rb b/lib/zitadel/client/models/beta_user_service_remove_phone_response.rb similarity index 93% rename from lib/zitadel/client/models/action_service_beta_function_execution.rb rename to lib/zitadel/client/models/beta_user_service_remove_phone_response.rb index 51c5e384..18cc3324 100644 --- a/lib/zitadel/client/models/action_service_beta_function_execution.rb +++ b/lib/zitadel/client/models/beta_user_service_remove_phone_response.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaFunctionExecution - attr_accessor :name + class BetaUserServiceRemovePhoneResponse + attr_accessor :details # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'name' => :'name' + :'details' => :'details' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'name' => :'String' + :'details' => :'BetaUserServiceDetails' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaFunctionExecution` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemovePhoneResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaFunctionExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemovePhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'name') - self.name = attributes[:'name'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - name == o.name + details == o.details end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name].hash + [details].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_request.rb b/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_request.rb new file mode 100644 index 00000000..b1ec870e --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRemoveTOTPRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveTOTPRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveTOTPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_response.rb b/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_response.rb new file mode 100644 index 00000000..c96e4a60 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRemoveTOTPResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveTOTPResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveTOTPResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_resend_email_code_request.rb b/lib/zitadel/client/models/beta_user_service_resend_email_code_request.rb new file mode 100644 index 00000000..b6b35bf0 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_resend_email_code_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceResendEmailCodeRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode7', + :'SendCode5' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/action_service_rpc_status.rb b/lib/zitadel/client/models/beta_user_service_resend_email_code_response.rb similarity index 87% rename from lib/zitadel/client/models/action_service_rpc_status.rb rename to lib/zitadel/client/models/beta_user_service_resend_email_code_response.rb index 869834b9..9ba2ce02 100644 --- a/lib/zitadel/client/models/action_service_rpc_status.rb +++ b/lib/zitadel/client/models/beta_user_service_resend_email_code_response.rb @@ -14,19 +14,17 @@ require 'time' module Zitadel::Client::Models - class ActionServiceRpcStatus - attr_accessor :code - - attr_accessor :message - + class BetaUserServiceResendEmailCodeResponse attr_accessor :details + # in case the verification was set to return_code, the code will be returned + attr_accessor :verification_code + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'details' => :'details', + :'verification_code' => :'verificationCode' } end @@ -43,15 +41,15 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'details' => :'BetaUserServiceDetails', + :'verification_code' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'verification_code' ]) end @@ -60,7 +58,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceResendEmailCodeResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,23 +66,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceResendEmailCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] end end @@ -108,9 +100,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + details == o.details && + verification_code == o.verification_code end # @see the `==` method @@ -122,7 +113,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [details, verification_code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_resend_phone_code_request.rb b/lib/zitadel/client/models/beta_user_service_resend_phone_code_request.rb new file mode 100644 index 00000000..10fe4468 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_resend_phone_code_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceResendPhoneCodeRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode8', + :'SendCode6' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_resend_phone_code_response.rb b/lib/zitadel/client/models/beta_user_service_resend_phone_code_response.rb new file mode 100644 index 00000000..efbbd739 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_resend_phone_code_response.rb @@ -0,0 +1,241 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceResendPhoneCodeResponse + attr_accessor :details + + # in case the verification was set to return_code, the code will be returned + attr_accessor :verification_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'verification_code' => :'verificationCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails', + :'verification_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'verification_code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceResendPhoneCodeResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceResendPhoneCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + verification_code == o.verification_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, verification_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rb b/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rb new file mode 100644 index 00000000..98bcdf59 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRetrieveIdentityProviderIntentRequest + attr_accessor :idp_intent_id + + attr_accessor :idp_intent_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'idp_intent_id' => :'idpIntentId', + :'idp_intent_token' => :'idpIntentToken' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'idp_intent_id' => :'String', + :'idp_intent_token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRetrieveIdentityProviderIntentRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRetrieveIdentityProviderIntentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'idp_intent_id') + self.idp_intent_id = attributes[:'idp_intent_id'] + end + + if attributes.key?(:'idp_intent_token') + self.idp_intent_token = attributes[:'idp_intent_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + idp_intent_id == o.idp_intent_id && + idp_intent_token == o.idp_intent_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [idp_intent_id, idp_intent_token].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rb b/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rb new file mode 100644 index 00000000..bfd6a290 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rb @@ -0,0 +1,248 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceRetrieveIdentityProviderIntentResponse + attr_accessor :details + + attr_accessor :idp_information + + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'idp_information' => :'idpInformation', + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails', + :'idp_information' => :'BetaUserServiceIDPInformation', + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRetrieveIdentityProviderIntentResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRetrieveIdentityProviderIntentResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'idp_information') + self.idp_information = attributes[:'idp_information'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + idp_information == o.idp_information && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, idp_information, user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_search_query.rb b/lib/zitadel/client/models/beta_user_service_search_query.rb new file mode 100644 index 00000000..084b22a2 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_search_query.rb @@ -0,0 +1,124 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceSearchQuery + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'AndQuery1', + :'DisplayNameQuery1', + :'EmailQuery1', + :'FirstNameQuery1', + :'InUserEmailsQuery1', + :'InUserIdsQuery1', + :'LastNameQuery1', + :'LoginNameQuery1', + :'NickNameQuery1', + :'NotQuery1', + :'OrQuery1', + :'OrganizationIdQuery1', + :'PhoneQuery1', + :'StateQuery2', + :'TypeQuery1', + :'UserNameQuery1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_set_email_request.rb b/lib/zitadel/client/models/beta_user_service_set_email_request.rb new file mode 100644 index 00000000..9a11827f --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_set_email_request.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceSetEmailRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IsVerified', + :'ReturnCode7', + :'SendCode5' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_set_email_response.rb b/lib/zitadel/client/models/beta_user_service_set_email_response.rb new file mode 100644 index 00000000..e5b1f75c --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_set_email_response.rb @@ -0,0 +1,241 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceSetEmailResponse + attr_accessor :details + + # in case the verification was set to return_code, the code will be returned + attr_accessor :verification_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'verification_code' => :'verificationCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails', + :'verification_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'verification_code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetEmailResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + verification_code == o.verification_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, verification_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_set_human_email.rb b/lib/zitadel/client/models/beta_user_service_set_human_email.rb new file mode 100644 index 00000000..27c0952f --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_set_human_email.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceSetHumanEmail + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IsVerified', + :'ReturnCode7', + :'SendCode5' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_set_human_phone.rb b/lib/zitadel/client/models/beta_user_service_set_human_phone.rb new file mode 100644 index 00000000..587cc45a --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_set_human_phone.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceSetHumanPhone + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IsVerified', + :'ReturnCode8', + :'SendCode6' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/user_service_nick_name_query.rb b/lib/zitadel/client/models/beta_user_service_set_human_profile.rb similarity index 74% rename from lib/zitadel/client/models/user_service_nick_name_query.rb rename to lib/zitadel/client/models/beta_user_service_set_human_profile.rb index 632b2194..d913962d 100644 --- a/lib/zitadel/client/models/user_service_nick_name_query.rb +++ b/lib/zitadel/client/models/beta_user_service_set_human_profile.rb @@ -14,11 +14,18 @@ require 'time' module Zitadel::Client::Models - # Query for users with a specific nickname. - class UserServiceNickNameQuery + class BetaUserServiceSetHumanProfile + attr_accessor :given_name + + attr_accessor :family_name + attr_accessor :nick_name - attr_accessor :method + attr_accessor :display_name + + attr_accessor :preferred_language + + attr_accessor :gender class EnumAttributeValidator attr_reader :datatype @@ -45,8 +52,12 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'given_name' => :'givenName', + :'family_name' => :'familyName', :'nick_name' => :'nickName', - :'method' => :'method' + :'display_name' => :'displayName', + :'preferred_language' => :'preferredLanguage', + :'gender' => :'gender' } end @@ -63,14 +74,21 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'given_name' => :'String', + :'family_name' => :'String', :'nick_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' + :'display_name' => :'String', + :'preferred_language' => :'String', + :'gender' => :'BetaUserServiceGender' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'nick_name', + :'display_name', + :'preferred_language', ]) end @@ -79,7 +97,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceNickNameQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetHumanProfile` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,21 +105,37 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceNickNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetHumanProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] + if attributes.key?(:'given_name') + self.given_name = attributes[:'given_name'] else - self.nick_name = nil + self.given_name = nil end - if attributes.key?(:'method') - self.method = attributes[:'method'] + if attributes.key?(:'family_name') + self.family_name = attributes[:'family_name'] else - self.method = 'TEXT_QUERY_METHOD_EQUALS' + self.family_name = nil + end + + if attributes.key?(:'nick_name') + self.nick_name = attributes[:'nick_name'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'preferred_language') + self.preferred_language = attributes[:'preferred_language'] + end + + if attributes.key?(:'gender') + self.gender = attributes[:'gender'] end end @@ -110,16 +144,12 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @nick_name.nil? - invalid_properties.push('invalid value for "nick_name", nick_name cannot be nil.') + if @given_name.nil? + invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') end - if @nick_name.to_s.length > 200 - invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 200.') - end - - if @nick_name.to_s.length < 1 - invalid_properties.push('invalid value for "nick_name", the character length must be great than or equal to 1.') + if @family_name.nil? + invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') end invalid_properties @@ -129,28 +159,29 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @nick_name.nil? - return false if @nick_name.to_s.length > 200 - return false if @nick_name.to_s.length < 1 + return false if @given_name.nil? + return false if @family_name.nil? true end # Custom attribute writer method with validation - # @param [Object] nick_name Value to be assigned - def nick_name=(nick_name) - if nick_name.nil? - fail ArgumentError, 'nick_name cannot be nil' + # @param [String] given_name Value to be assigned + def given_name=(given_name) + if given_name.nil? + fail ArgumentError, 'given_name cannot be nil' end - if nick_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 200.' - end + @given_name = given_name + end - if nick_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "nick_name", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] family_name Value to be assigned + def family_name=(family_name) + if family_name.nil? + fail ArgumentError, 'family_name cannot be nil' end - @nick_name = nick_name + @family_name = family_name end # Checks equality by comparing each attribute. @@ -158,8 +189,12 @@ def nick_name=(nick_name) def ==(o) return true if self.equal?(o) self.class == o.class && + given_name == o.given_name && + family_name == o.family_name && nick_name == o.nick_name && - method == o.method + display_name == o.display_name && + preferred_language == o.preferred_language && + gender == o.gender end # @see the `==` method @@ -171,7 +206,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [nick_name, method].hash + [given_name, family_name, nick_name, display_name, preferred_language, gender].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_set_metadata_entry.rb b/lib/zitadel/client/models/beta_user_service_set_metadata_entry.rb new file mode 100644 index 00000000..7389fd78 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_set_metadata_entry.rb @@ -0,0 +1,273 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceSetMetadataEntry + attr_accessor :key + + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'key' => :'key', + :'value' => :'value' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'key' => :'String', + :'value' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetMetadataEntry` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetMetadataEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + else + self.key = nil + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + else + self.value = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @key.nil? + invalid_properties.push('invalid value for "key", key cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @key.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] key Value to be assigned + def key=(key) + if key.nil? + fail ArgumentError, 'key cannot be nil' + end + + @key = key + end + + # Custom attribute writer method with validation + # @param [String] value Value to be assigned + def value=(value) + if value.nil? + fail ArgumentError, 'value cannot be nil' + end + + @value = value + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [key, value].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_l_d_a_p_credentials.rb b/lib/zitadel/client/models/beta_user_service_set_password.rb similarity index 70% rename from lib/zitadel/client/models/user_service_l_d_a_p_credentials.rb rename to lib/zitadel/client/models/beta_user_service_set_password.rb index f8cb8b68..dedf38d9 100644 --- a/lib/zitadel/client/models/user_service_l_d_a_p_credentials.rb +++ b/lib/zitadel/client/models/beta_user_service_set_password.rb @@ -14,18 +14,22 @@ require 'time' module Zitadel::Client::Models - class UserServiceLDAPCredentials - # Username used to login through LDAP - attr_accessor :username + class BetaUserServiceSetPassword + attr_accessor :hashed_password - # Password used to login through LDAP attr_accessor :password + attr_accessor :current_password + + attr_accessor :verification_code + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'username' => :'username', - :'password' => :'password' + :'hashed_password' => :'hashedPassword', + :'password' => :'password', + :'current_password' => :'currentPassword', + :'verification_code' => :'verificationCode' } end @@ -42,8 +46,10 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'username' => :'String', - :'password' => :'String' + :'hashed_password' => :'BetaUserServiceHashedPassword', + :'password' => :'BetaUserServicePassword', + :'current_password' => :'String', + :'verification_code' => :'String' } end @@ -58,7 +64,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLDAPCredentials` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetPassword` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,17 +72,33 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLDAPCredentials`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'username') - self.username = attributes[:'username'] + if attributes.key?(:'hashed_password') + self.hashed_password = attributes[:'hashed_password'] + else + self.hashed_password = nil end if attributes.key?(:'password') self.password = attributes[:'password'] + else + self.password = nil + end + + if attributes.key?(:'current_password') + self.current_password = attributes[:'current_password'] + else + self.current_password = nil + end + + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] + else + self.verification_code = nil end end @@ -85,20 +107,20 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@username.nil? && @username.to_s.length > 200 - invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 200.') + if @hashed_password.nil? + invalid_properties.push('invalid value for "hashed_password", hashed_password cannot be nil.') end - if !@username.nil? && @username.to_s.length < 1 - invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.') + if @password.nil? + invalid_properties.push('invalid value for "password", password cannot be nil.') end - if !@password.nil? && @password.to_s.length > 200 - invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 200.') + if @current_password.nil? + invalid_properties.push('invalid value for "current_password", current_password cannot be nil.') end - if !@password.nil? && @password.to_s.length < 1 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.') + if @verification_code.nil? + invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') end invalid_properties @@ -108,47 +130,51 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@username.nil? && @username.to_s.length > 200 - return false if !@username.nil? && @username.to_s.length < 1 - return false if !@password.nil? && @password.to_s.length > 200 - return false if !@password.nil? && @password.to_s.length < 1 + return false if @hashed_password.nil? + return false if @password.nil? + return false if @current_password.nil? + return false if @verification_code.nil? true end # Custom attribute writer method with validation - # @param [Object] username Value to be assigned - def username=(username) - if username.nil? - fail ArgumentError, 'username cannot be nil' - end - - if username.to_s.length > 200 - fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 200.' - end - - if username.to_s.length < 1 - fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.' + # @param [BetaUserServiceHashedPassword] hashed_password Value to be assigned + def hashed_password=(hashed_password) + if hashed_password.nil? + fail ArgumentError, 'hashed_password cannot be nil' end - @username = username + @hashed_password = hashed_password end # Custom attribute writer method with validation - # @param [Object] password Value to be assigned + # @param [BetaUserServicePassword] password Value to be assigned def password=(password) if password.nil? fail ArgumentError, 'password cannot be nil' end - if password.to_s.length > 200 - fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 200.' + @password = password + end + + # Custom attribute writer method with validation + # @param [String] current_password Value to be assigned + def current_password=(current_password) + if current_password.nil? + fail ArgumentError, 'current_password cannot be nil' end - if password.to_s.length < 1 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.' + @current_password = current_password + end + + # Custom attribute writer method with validation + # @param [String] verification_code Value to be assigned + def verification_code=(verification_code) + if verification_code.nil? + fail ArgumentError, 'verification_code cannot be nil' end - @password = password + @verification_code = verification_code end # Checks equality by comparing each attribute. @@ -156,8 +182,10 @@ def password=(password) def ==(o) return true if self.equal?(o) self.class == o.class && - username == o.username && - password == o.password + hashed_password == o.hashed_password && + password == o.password && + current_password == o.current_password && + verification_code == o.verification_code end # @see the `==` method @@ -169,7 +197,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [username, password].hash + [hashed_password, password, current_password, verification_code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_set_password_request.rb b/lib/zitadel/client/models/beta_user_service_set_password_request.rb new file mode 100644 index 00000000..0b94f78d --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_set_password_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceSetPasswordRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CurrentPassword', + :'VerificationCode' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/action_service_beta_in_target_i_ds_filter.rb b/lib/zitadel/client/models/beta_user_service_set_password_response.rb similarity index 92% rename from lib/zitadel/client/models/action_service_beta_in_target_i_ds_filter.rb rename to lib/zitadel/client/models/beta_user_service_set_password_response.rb index 4522325d..3299a9fb 100644 --- a/lib/zitadel/client/models/action_service_beta_in_target_i_ds_filter.rb +++ b/lib/zitadel/client/models/beta_user_service_set_password_response.rb @@ -14,14 +14,13 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaInTargetIDsFilter - # the ids of the targets to include - attr_accessor :target_ids + class BetaUserServiceSetPasswordResponse + attr_accessor :details # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'target_ids' => :'targetIds' + :'details' => :'details' } end @@ -38,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'target_ids' => :'Array' + :'details' => :'BetaUserServiceDetails' } end @@ -53,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaInTargetIDsFilter` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetPasswordResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,15 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaInTargetIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetPasswordResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'target_ids') - if (value = attributes[:'target_ids']).is_a?(Array) - self.target_ids = value - end + if attributes.key?(:'details') + self.details = attributes[:'details'] end end @@ -93,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - target_ids == o.target_ids + details == o.details end # @see the `==` method @@ -105,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [target_ids].hash + [details].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_set_phone_request.rb b/lib/zitadel/client/models/beta_user_service_set_phone_request.rb new file mode 100644 index 00000000..a09b5e5c --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_set_phone_request.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceSetPhoneRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IsVerified', + :'ReturnCode8', + :'SendCode6' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_set_phone_response.rb b/lib/zitadel/client/models/beta_user_service_set_phone_response.rb new file mode 100644 index 00000000..c9f3ddcf --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_set_phone_response.rb @@ -0,0 +1,241 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceSetPhoneResponse + attr_accessor :details + + # in case the verification was set to return_code, the code will be returned + attr_accessor :verification_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'verification_code' => :'verificationCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails', + :'verification_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'verification_code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetPhoneResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetPhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + verification_code == o.verification_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, verification_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rb b/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rb new file mode 100644 index 00000000..f3a65afb --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceStartIdentityProviderIntentRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Ldap3', + :'Urls1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rb b/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rb new file mode 100644 index 00000000..3ff2662b --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceStartIdentityProviderIntentResponse + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'AuthUrl', + :'IdpIntent1', + :'PostForm' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_unlock_user_request.rb b/lib/zitadel/client/models/beta_user_service_unlock_user_request.rb new file mode 100644 index 00000000..ecf40913 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_unlock_user_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceUnlockUserRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUnlockUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUnlockUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_unlock_user_response.rb b/lib/zitadel/client/models/beta_user_service_unlock_user_response.rb new file mode 100644 index 00000000..384f9c54 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_unlock_user_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceUnlockUserResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUnlockUserResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUnlockUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_set_human_phone.rb b/lib/zitadel/client/models/beta_user_service_update_human_user_request.rb similarity index 80% rename from lib/zitadel/client/models/organization_service_set_human_phone.rb rename to lib/zitadel/client/models/beta_user_service_update_human_user_request.rb index 826b79d7..31aa9b85 100644 --- a/lib/zitadel/client/models/organization_service_set_human_phone.rb +++ b/lib/zitadel/client/models/beta_user_service_update_human_user_request.rb @@ -14,22 +14,28 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceSetHumanPhone - attr_accessor :phone + class BetaUserServiceUpdateHumanUserRequest + attr_accessor :user_id + + attr_accessor :username - attr_accessor :send_code + attr_accessor :profile - attr_accessor :return_code + attr_accessor :email - attr_accessor :is_verified + attr_accessor :phone + + attr_accessor :password # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', + :'username' => :'username', + :'profile' => :'profile', + :'email' => :'email', :'phone' => :'phone', - :'send_code' => :'sendCode', - :'return_code' => :'returnCode', - :'is_verified' => :'isVerified' + :'password' => :'password' } end @@ -46,16 +52,19 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'phone' => :'String', - :'send_code' => :'Object', - :'return_code' => :'Object', - :'is_verified' => :'Boolean' + :'user_id' => :'String', + :'username' => :'String', + :'profile' => :'BetaUserServiceSetHumanProfile', + :'email' => :'BetaUserServiceSetHumanEmail', + :'phone' => :'BetaUserServiceSetHumanPhone', + :'password' => :'BetaUserServiceSetPassword' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'username', ]) end @@ -64,7 +73,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetHumanPhone` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUpdateHumanUserRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -72,25 +81,33 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetHumanPhone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUpdateHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'profile') + self.profile = attributes[:'profile'] end - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] + if attributes.key?(:'email') + self.email = attributes[:'email'] end - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] + if attributes.key?(:'phone') + self.phone = attributes[:'phone'] end - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] + if attributes.key?(:'password') + self.password = attributes[:'password'] end end @@ -99,10 +116,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@phone.nil? && @phone.to_s.length > 200 - invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 200.') - end - invalid_properties end @@ -110,33 +123,20 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@phone.nil? && @phone.to_s.length > 200 true end - # Custom attribute writer method with validation - # @param [Object] phone Value to be assigned - def phone=(phone) - if phone.nil? - fail ArgumentError, 'phone cannot be nil' - end - - if phone.to_s.length > 200 - fail ArgumentError, 'invalid value for "phone", the character length must be smaller than or equal to 200.' - end - - @phone = phone - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && + username == o.username && + profile == o.profile && + email == o.email && phone == o.phone && - send_code == o.send_code && - return_code == o.return_code && - is_verified == o.is_verified + password == o.password end # @see the `==` method @@ -148,7 +148,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [phone, send_code, return_code, is_verified].hash + [user_id, username, profile, email, phone, password].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_update_human_user_response.rb b/lib/zitadel/client/models/beta_user_service_update_human_user_response.rb new file mode 100644 index 00000000..ae2f7d23 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_update_human_user_response.rb @@ -0,0 +1,250 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceUpdateHumanUserResponse + attr_accessor :details + + attr_accessor :email_code + + attr_accessor :phone_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details', + :'email_code' => :'emailCode', + :'phone_code' => :'phoneCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails', + :'email_code' => :'String', + :'phone_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'email_code', + :'phone_code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUpdateHumanUserResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUpdateHumanUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'email_code') + self.email_code = attributes[:'email_code'] + end + + if attributes.key?(:'phone_code') + self.phone_code = attributes[:'phone_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + email_code == o.email_code && + phone_code == o.phone_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, email_code, phone_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_user.rb b/lib/zitadel/client/models/beta_user_service_user.rb new file mode 100644 index 00000000..bea7458b --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_user.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaUserServiceUser + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Human1', + :'Machine' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_user_field_name.rb b/lib/zitadel/client/models/beta_user_service_user_field_name.rb new file mode 100644 index 00000000..143e2a6d --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_user_field_name.rb @@ -0,0 +1,49 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceUserFieldName + USER_FIELD_NAME_UNSPECIFIED = "USER_FIELD_NAME_UNSPECIFIED".freeze + USER_FIELD_NAME_USER_NAME = "USER_FIELD_NAME_USER_NAME".freeze + USER_FIELD_NAME_FIRST_NAME = "USER_FIELD_NAME_FIRST_NAME".freeze + USER_FIELD_NAME_LAST_NAME = "USER_FIELD_NAME_LAST_NAME".freeze + USER_FIELD_NAME_NICK_NAME = "USER_FIELD_NAME_NICK_NAME".freeze + USER_FIELD_NAME_DISPLAY_NAME = "USER_FIELD_NAME_DISPLAY_NAME".freeze + USER_FIELD_NAME_EMAIL = "USER_FIELD_NAME_EMAIL".freeze + USER_FIELD_NAME_STATE = "USER_FIELD_NAME_STATE".freeze + USER_FIELD_NAME_TYPE = "USER_FIELD_NAME_TYPE".freeze + USER_FIELD_NAME_CREATION_DATE = "USER_FIELD_NAME_CREATION_DATE".freeze + + def self.all_vars + @all_vars ||= [USER_FIELD_NAME_UNSPECIFIED, USER_FIELD_NAME_USER_NAME, USER_FIELD_NAME_FIRST_NAME, USER_FIELD_NAME_LAST_NAME, USER_FIELD_NAME_NICK_NAME, USER_FIELD_NAME_DISPLAY_NAME, USER_FIELD_NAME_EMAIL, USER_FIELD_NAME_STATE, USER_FIELD_NAME_TYPE, USER_FIELD_NAME_CREATION_DATE].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaUserServiceUserFieldName.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceUserFieldName" + end + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_user_state.rb b/lib/zitadel/client/models/beta_user_service_user_state.rb new file mode 100644 index 00000000..d5f54256 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_user_state.rb @@ -0,0 +1,45 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceUserState + USER_STATE_UNSPECIFIED = "USER_STATE_UNSPECIFIED".freeze + USER_STATE_ACTIVE = "USER_STATE_ACTIVE".freeze + USER_STATE_INACTIVE = "USER_STATE_INACTIVE".freeze + USER_STATE_DELETED = "USER_STATE_DELETED".freeze + USER_STATE_LOCKED = "USER_STATE_LOCKED".freeze + USER_STATE_INITIAL = "USER_STATE_INITIAL".freeze + + def self.all_vars + @all_vars ||= [USER_STATE_UNSPECIFIED, USER_STATE_ACTIVE, USER_STATE_INACTIVE, USER_STATE_DELETED, USER_STATE_LOCKED, USER_STATE_INITIAL].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if BetaUserServiceUserState.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceUserState" + end + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_value.rb b/lib/zitadel/client/models/beta_user_service_value.rb new file mode 100644 index 00000000..83a06e7a --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_value.rb @@ -0,0 +1,114 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +# `Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of these variants. Absence of any variant indicates an error. The JSON representation for `Value` is JSON value. +module BetaUserServiceValue + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'Boolean', + :'Float', + :'Hash', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/beta_user_service_verify_email_request.rb b/lib/zitadel/client/models/beta_user_service_verify_email_request.rb new file mode 100644 index 00000000..689efc7c --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_email_request.rb @@ -0,0 +1,273 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceVerifyEmailRequest + attr_accessor :user_id + + attr_accessor :verification_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'verification_code' => :'verificationCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'verification_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyEmailRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] + else + self.verification_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @verification_code.nil? + invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + return false if @verification_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] verification_code Value to be assigned + def verification_code=(verification_code) + if verification_code.nil? + fail ArgumentError, 'verification_code cannot be nil' + end + + @verification_code = verification_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + verification_code == o.verification_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, verification_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_verify_email_response.rb b/lib/zitadel/client/models/beta_user_service_verify_email_response.rb new file mode 100644 index 00000000..97ae7902 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_email_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceVerifyEmailResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyEmailResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_i_d_p_link.rb b/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rb similarity index 66% rename from lib/zitadel/client/models/organization_service_i_d_p_link.rb rename to lib/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rb index bab15485..7d3c54c5 100644 --- a/lib/zitadel/client/models/organization_service_i_d_p_link.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rb @@ -14,22 +14,23 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceIDPLink - # ID of the identity provider - attr_accessor :idp_id - - # ID of the user of the identity provider + class BetaUserServiceVerifyPasskeyRegistrationRequest attr_accessor :user_id - # username of the user of the identity provider - attr_accessor :user_name + attr_accessor :passkey_id + + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + attr_accessor :public_key_credential + + attr_accessor :passkey_name # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'idp_id' => :'idpId', :'user_id' => :'userId', - :'user_name' => :'userName' + :'passkey_id' => :'passkeyId', + :'public_key_credential' => :'publicKeyCredential', + :'passkey_name' => :'passkeyName' } end @@ -46,9 +47,10 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'idp_id' => :'String', :'user_id' => :'String', - :'user_name' => :'String' + :'passkey_id' => :'String', + :'public_key_credential' => :'Hash', + :'passkey_name' => :'String' } end @@ -63,7 +65,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceIDPLink` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyPasskeyRegistrationRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -71,21 +73,35 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceIDPLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyPasskeyRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'passkey_id') + self.passkey_id = attributes[:'passkey_id'] + else + self.passkey_id = nil + end + + if attributes.key?(:'public_key_credential') + if (value = attributes[:'public_key_credential']).is_a?(Hash) + self.public_key_credential = value + end + else + self.public_key_credential = nil end - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] + if attributes.key?(:'passkey_name') + self.passkey_name = attributes[:'passkey_name'] + else + self.passkey_name = nil end end @@ -94,28 +110,20 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@idp_id.nil? && @idp_id.to_s.length > 200 - invalid_properties.push('invalid value for "idp_id", the character length must be smaller than or equal to 200.') - end - - if !@idp_id.nil? && @idp_id.to_s.length < 1 - invalid_properties.push('invalid value for "idp_id", the character length must be great than or equal to 1.') + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end - if !@user_id.nil? && @user_id.to_s.length > 200 - invalid_properties.push('invalid value for "user_id", the character length must be smaller than or equal to 200.') + if @passkey_id.nil? + invalid_properties.push('invalid value for "passkey_id", passkey_id cannot be nil.') end - if !@user_id.nil? && @user_id.to_s.length < 1 - invalid_properties.push('invalid value for "user_id", the character length must be great than or equal to 1.') + if @public_key_credential.nil? + invalid_properties.push('invalid value for "public_key_credential", public_key_credential cannot be nil.') end - if !@user_name.nil? && @user_name.to_s.length > 200 - invalid_properties.push('invalid value for "user_name", the character length must be smaller than or equal to 200.') - end - - if !@user_name.nil? && @user_name.to_s.length < 1 - invalid_properties.push('invalid value for "user_name", the character length must be great than or equal to 1.') + if @passkey_name.nil? + invalid_properties.push('invalid value for "passkey_name", passkey_name cannot be nil.') end invalid_properties @@ -125,67 +133,51 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@idp_id.nil? && @idp_id.to_s.length > 200 - return false if !@idp_id.nil? && @idp_id.to_s.length < 1 - return false if !@user_id.nil? && @user_id.to_s.length > 200 - return false if !@user_id.nil? && @user_id.to_s.length < 1 - return false if !@user_name.nil? && @user_name.to_s.length > 200 - return false if !@user_name.nil? && @user_name.to_s.length < 1 + return false if @user_id.nil? + return false if @passkey_id.nil? + return false if @public_key_credential.nil? + return false if @passkey_name.nil? true end # Custom attribute writer method with validation - # @param [Object] idp_id Value to be assigned - def idp_id=(idp_id) - if idp_id.nil? - fail ArgumentError, 'idp_id cannot be nil' - end - - if idp_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "idp_id", the character length must be smaller than or equal to 200.' - end - - if idp_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "idp_id", the character length must be great than or equal to 1.' - end - - @idp_id = idp_id - end - - # Custom attribute writer method with validation - # @param [Object] user_id Value to be assigned + # @param [String] user_id Value to be assigned def user_id=(user_id) if user_id.nil? fail ArgumentError, 'user_id cannot be nil' end - if user_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_id", the character length must be smaller than or equal to 200.' - end + @user_id = user_id + end - if user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "user_id", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] passkey_id Value to be assigned + def passkey_id=(passkey_id) + if passkey_id.nil? + fail ArgumentError, 'passkey_id cannot be nil' end - @user_id = user_id + @passkey_id = passkey_id end # Custom attribute writer method with validation - # @param [Object] user_name Value to be assigned - def user_name=(user_name) - if user_name.nil? - fail ArgumentError, 'user_name cannot be nil' + # @param [Hash] public_key_credential Value to be assigned + def public_key_credential=(public_key_credential) + if public_key_credential.nil? + fail ArgumentError, 'public_key_credential cannot be nil' end - if user_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_name", the character length must be smaller than or equal to 200.' - end + @public_key_credential = public_key_credential + end - if user_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "user_name", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] passkey_name Value to be assigned + def passkey_name=(passkey_name) + if passkey_name.nil? + fail ArgumentError, 'passkey_name cannot be nil' end - @user_name = user_name + @passkey_name = passkey_name end # Checks equality by comparing each attribute. @@ -193,9 +185,10 @@ def user_name=(user_name) def ==(o) return true if self.equal?(o) self.class == o.class && - idp_id == o.idp_id && user_id == o.user_id && - user_name == o.user_name + passkey_id == o.passkey_id && + public_key_credential == o.public_key_credential && + passkey_name == o.passkey_name end # @see the `==` method @@ -207,7 +200,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [idp_id, user_id, user_name].hash + [user_id, passkey_id, public_key_credential, passkey_name].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rb b/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rb new file mode 100644 index 00000000..6fffa22c --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceVerifyPasskeyRegistrationResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyPasskeyRegistrationResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyPasskeyRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_verify_phone_request.rb b/lib/zitadel/client/models/beta_user_service_verify_phone_request.rb new file mode 100644 index 00000000..248f62d7 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_phone_request.rb @@ -0,0 +1,273 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceVerifyPhoneRequest + attr_accessor :user_id + + attr_accessor :verification_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'verification_code' => :'verificationCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'verification_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyPhoneRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyPhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] + else + self.verification_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @verification_code.nil? + invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + return false if @verification_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] verification_code Value to be assigned + def verification_code=(verification_code) + if verification_code.nil? + fail ArgumentError, 'verification_code cannot be nil' + end + + @verification_code = verification_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + verification_code == o.verification_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, verification_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_verify_phone_response.rb b/lib/zitadel/client/models/beta_user_service_verify_phone_response.rb new file mode 100644 index 00000000..1b13e2d9 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_phone_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceVerifyPhoneResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyPhoneResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyPhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_request.rb b/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_request.rb new file mode 100644 index 00000000..5e58943a --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_request.rb @@ -0,0 +1,273 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceVerifyTOTPRegistrationRequest + attr_accessor :user_id + + attr_accessor :code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'code' => :'code' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyTOTPRegistrationRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyTOTPRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + else + self.code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + return false if @code.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' + end + + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + code == o.code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_response.rb b/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_response.rb new file mode 100644 index 00000000..a7eef4aa --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceVerifyTOTPRegistrationResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyTOTPRegistrationResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyTOTPRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_set_metadata_entry.rb b/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rb similarity index 65% rename from lib/zitadel/client/models/organization_service_set_metadata_entry.rb rename to lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rb index d2177396..08986145 100644 --- a/lib/zitadel/client/models/organization_service_set_metadata_entry.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rb @@ -14,17 +14,23 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceSetMetadataEntry - attr_accessor :key + class BetaUserServiceVerifyU2FRegistrationRequest + attr_accessor :user_id - # The value has to be base64 encoded. - attr_accessor :value + attr_accessor :u2f_id + + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + attr_accessor :public_key_credential + + attr_accessor :token_name # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'key' => :'key', - :'value' => :'value' + :'user_id' => :'userId', + :'u2f_id' => :'u2fId', + :'public_key_credential' => :'publicKeyCredential', + :'token_name' => :'tokenName' } end @@ -41,8 +47,10 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'key' => :'String', - :'value' => :'String' + :'user_id' => :'String', + :'u2f_id' => :'String', + :'public_key_credential' => :'Hash', + :'token_name' => :'String' } end @@ -57,7 +65,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetMetadataEntry` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyU2FRegistrationRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -65,21 +73,35 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetMetadataEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyU2FRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'key') - self.key = attributes[:'key'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'u2f_id') + self.u2f_id = attributes[:'u2f_id'] else - self.key = nil + self.u2f_id = nil end - if attributes.key?(:'value') - self.value = attributes[:'value'] + if attributes.key?(:'public_key_credential') + if (value = attributes[:'public_key_credential']).is_a?(Hash) + self.public_key_credential = value + end else - self.value = nil + self.public_key_credential = nil + end + + if attributes.key?(:'token_name') + self.token_name = attributes[:'token_name'] + else + self.token_name = nil end end @@ -88,28 +110,20 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @key.nil? - invalid_properties.push('invalid value for "key", key cannot be nil.') + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end - if @key.to_s.length > 200 - invalid_properties.push('invalid value for "key", the character length must be smaller than or equal to 200.') + if @u2f_id.nil? + invalid_properties.push('invalid value for "u2f_id", u2f_id cannot be nil.') end - if @key.to_s.length < 1 - invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.') + if @public_key_credential.nil? + invalid_properties.push('invalid value for "public_key_credential", public_key_credential cannot be nil.') end - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @value.to_s.length > 500000 - invalid_properties.push('invalid value for "value", the character length must be smaller than or equal to 500000.') - end - - if @value.to_s.length < 1 - invalid_properties.push('invalid value for "value", the character length must be great than or equal to 1.') + if @token_name.nil? + invalid_properties.push('invalid value for "token_name", token_name cannot be nil.') end invalid_properties @@ -119,49 +133,51 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @key.nil? - return false if @key.to_s.length > 200 - return false if @key.to_s.length < 1 - return false if @value.nil? - return false if @value.to_s.length > 500000 - return false if @value.to_s.length < 1 + return false if @user_id.nil? + return false if @u2f_id.nil? + return false if @public_key_credential.nil? + return false if @token_name.nil? true end # Custom attribute writer method with validation - # @param [Object] key Value to be assigned - def key=(key) - if key.nil? - fail ArgumentError, 'key cannot be nil' + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' end - if key.to_s.length > 200 - fail ArgumentError, 'invalid value for "key", the character length must be smaller than or equal to 200.' - end + @user_id = user_id + end - if key.to_s.length < 1 - fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] u2f_id Value to be assigned + def u2f_id=(u2f_id) + if u2f_id.nil? + fail ArgumentError, 'u2f_id cannot be nil' end - @key = key + @u2f_id = u2f_id end # Custom attribute writer method with validation - # @param [Object] value Value to be assigned - def value=(value) - if value.nil? - fail ArgumentError, 'value cannot be nil' + # @param [Hash] public_key_credential Value to be assigned + def public_key_credential=(public_key_credential) + if public_key_credential.nil? + fail ArgumentError, 'public_key_credential cannot be nil' end - if value.to_s.length > 500000 - fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to 500000.' - end + @public_key_credential = public_key_credential + end - if value.to_s.length < 1 - fail ArgumentError, 'invalid value for "value", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] token_name Value to be assigned + def token_name=(token_name) + if token_name.nil? + fail ArgumentError, 'token_name cannot be nil' end - @value = value + @token_name = token_name end # Checks equality by comparing each attribute. @@ -169,8 +185,10 @@ def value=(value) def ==(o) return true if self.equal?(o) self.class == o.class && - key == o.key && - value == o.value + user_id == o.user_id && + u2f_id == o.u2f_id && + public_key_credential == o.public_key_credential && + token_name == o.token_name end # @see the `==` method @@ -182,7 +200,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [key, value].hash + [user_id, u2f_id, public_key_credential, token_name].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rb b/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rb new file mode 100644 index 00000000..307c3b7c --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaUserServiceVerifyU2FRegistrationResponse + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'details' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'BetaUserServiceDetails' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyU2FRegistrationResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyU2FRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_create_web_key_response.rb b/lib/zitadel/client/models/beta_web_key_service_activate_web_key_request.rb similarity index 89% rename from lib/zitadel/client/models/web_key_service_beta_create_web_key_response.rb rename to lib/zitadel/client/models/beta_web_key_service_activate_web_key_request.rb index 01bcd248..93840472 100644 --- a/lib/zitadel/client/models/web_key_service_beta_create_web_key_response.rb +++ b/lib/zitadel/client/models/beta_web_key_service_activate_web_key_request.rb @@ -14,18 +14,13 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaCreateWebKeyResponse - # The unique identifier of the newly created key. + class BetaWebKeyServiceActivateWebKeyRequest attr_accessor :id - # The timestamp of the key creation. - attr_accessor :creation_date - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - :'creation_date' => :'creationDate' + :'id' => :'id' } end @@ -42,8 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - :'creation_date' => :'Time' + :'id' => :'String' } end @@ -58,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaCreateWebKeyResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceActivateWebKeyRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaCreateWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceActivateWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] + else + self.id = nil end end @@ -85,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + invalid_properties end @@ -92,16 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? true end + # Custom attribute writer method with validation + # @param [String] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - id == o.id && - creation_date == o.creation_date + id == o.id end # @see the `==` method @@ -113,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, creation_date].hash + [id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/action_service_beta_execution.rb b/lib/zitadel/client/models/beta_web_key_service_activate_web_key_response.rb similarity index 61% rename from lib/zitadel/client/models/action_service_beta_execution.rb rename to lib/zitadel/client/models/beta_web_key_service_activate_web_key_response.rb index e85cd986..85effa3a 100644 --- a/lib/zitadel/client/models/action_service_beta_execution.rb +++ b/lib/zitadel/client/models/beta_web_key_service_activate_web_key_response.rb @@ -14,25 +14,14 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaExecution - attr_accessor :condition - - # The timestamp of the execution creation. - attr_accessor :creation_date - - # The timestamp of the last change to the execution. + class BetaWebKeyServiceActivateWebKeyResponse + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date - # Ordered list of targets called during the execution. - attr_accessor :targets - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'condition' => :'condition', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'targets' => :'targets' + :'change_date' => :'changeDate' } end @@ -49,10 +38,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'condition' => :'ActionServiceBetaCondition', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'targets' => :'Array' + :'change_date' => :'Time' } end @@ -67,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaExecution` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceActivateWebKeyResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -75,28 +61,14 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceActivateWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - if attributes.key?(:'change_date') self.change_date = attributes[:'change_date'] end - - if attributes.key?(:'targets') - if (value = attributes[:'targets']).is_a?(Array) - self.targets = value - end - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -119,10 +91,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - condition == o.condition && - creation_date == o.creation_date && - change_date == o.change_date && - targets == o.targets + change_date == o.change_date end # @see the `==` method @@ -134,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [condition, creation_date, change_date, targets].hash + [change_date].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/s_a_m_l_service_rpc_status.rb b/lib/zitadel/client/models/beta_web_key_service_any.rb similarity index 88% rename from lib/zitadel/client/models/s_a_m_l_service_rpc_status.rb rename to lib/zitadel/client/models/beta_web_key_service_any.rb index e1880b5a..ffce64a2 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_rpc_status.rb +++ b/lib/zitadel/client/models/beta_web_key_service_any.rb @@ -14,19 +14,20 @@ require 'time' module Zitadel::Client::Models - class SAMLServiceRpcStatus - attr_accessor :code + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class BetaWebKeyServiceAny + attr_accessor :type - attr_accessor :message + attr_accessor :value - attr_accessor :details + attr_accessor :debug # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' } end @@ -43,9 +44,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' } end @@ -60,7 +61,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceAny` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,22 +69,22 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] + if attributes.key?(:'type') + self.type = attributes[:'type'] end - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'value') + self.value = attributes[:'value'] end - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value end end end @@ -108,9 +109,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + type == o.type && + value == o.value && + debug == o.debug end # @see the `==` method @@ -122,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [type, value, debug].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_web_key_service_connect_error.rb b/lib/zitadel/client/models/beta_web_key_service_connect_error.rb new file mode 100644 index 00000000..56b41032 --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaWebKeyServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'BetaWebKeyServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_web_key_service_create_web_key_request.rb b/lib/zitadel/client/models/beta_web_key_service_create_web_key_request.rb new file mode 100644 index 00000000..e4c2e849 --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_create_web_key_request.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaWebKeyServiceCreateWebKeyRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Ecdsa', + :'Ed25519', + :'Rsa' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_web_key.rb b/lib/zitadel/client/models/beta_web_key_service_create_web_key_response.rb similarity index 61% rename from lib/zitadel/client/models/web_key_service_beta_web_key.rb rename to lib/zitadel/client/models/beta_web_key_service_create_web_key_response.rb index 8f4e4ce5..6534231a 100644 --- a/lib/zitadel/client/models/web_key_service_beta_web_key.rb +++ b/lib/zitadel/client/models/beta_web_key_service_create_web_key_response.rb @@ -14,34 +14,18 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaWebKey - # The unique identifier of the key. + class BetaWebKeyServiceCreateWebKeyResponse + # The unique identifier of the newly created key. attr_accessor :id - # The timestamp of the key creation. + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date - # The timestamp of the last change to the key (e.g. creation, activation, deactivation). - attr_accessor :change_date - - attr_accessor :state - - attr_accessor :rsa - - attr_accessor :ecdsa - - attr_accessor :ed25519 - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'state' => :'state', - :'rsa' => :'rsa', - :'ecdsa' => :'ecdsa', - :'ed25519' => :'ed25519' + :'creation_date' => :'creationDate' } end @@ -59,12 +43,7 @@ def self.acceptable_attributes def self.openapi_types { :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'state' => :'WebKeyServiceBetaState', - :'rsa' => :'WebKeyServiceBetaRSA', - :'ecdsa' => :'WebKeyServiceBetaECDSA', - :'ed25519' => :'Object' + :'creation_date' => :'Time' } end @@ -79,7 +58,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaWebKey` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceCreateWebKeyResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,7 +66,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaWebKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceCreateWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -99,28 +78,6 @@ def initialize(attributes = {}) if attributes.key?(:'creation_date') self.creation_date = attributes[:'creation_date'] end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - else - self.state = 'STATE_UNSPECIFIED' - end - - if attributes.key?(:'rsa') - self.rsa = attributes[:'rsa'] - end - - if attributes.key?(:'ecdsa') - self.ecdsa = attributes[:'ecdsa'] - end - - if attributes.key?(:'ed25519') - self.ed25519 = attributes[:'ed25519'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -144,12 +101,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - state == o.state && - rsa == o.rsa && - ecdsa == o.ecdsa && - ed25519 == o.ed25519 + creation_date == o.creation_date end # @see the `==` method @@ -161,7 +113,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, creation_date, change_date, state, rsa, ecdsa, ed25519].hash + [id, creation_date].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/beta_web_key_service_delete_web_key_request.rb b/lib/zitadel/client/models/beta_web_key_service_delete_web_key_request.rb new file mode 100644 index 00000000..769c5fce --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_delete_web_key_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaWebKeyServiceDeleteWebKeyRequest + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceDeleteWebKeyRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceDeleteWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/beta_web_key_service_delete_web_key_response.rb b/lib/zitadel/client/models/beta_web_key_service_delete_web_key_response.rb new file mode 100644 index 00000000..04cc954b --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_delete_web_key_response.rb @@ -0,0 +1,231 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class BetaWebKeyServiceDeleteWebKeyResponse + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + attr_accessor :deletion_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'deletion_date' => :'deletionDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'deletion_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceDeleteWebKeyResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceDeleteWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'deletion_date') + self.deletion_date = attributes[:'deletion_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deletion_date == o.deletion_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [deletion_date].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_list_web_keys_response.rb b/lib/zitadel/client/models/beta_web_key_service_list_web_keys_response.rb similarity index 96% rename from lib/zitadel/client/models/web_key_service_beta_list_web_keys_response.rb rename to lib/zitadel/client/models/beta_web_key_service_list_web_keys_response.rb index 839e2c5d..896b601e 100644 --- a/lib/zitadel/client/models/web_key_service_beta_list_web_keys_response.rb +++ b/lib/zitadel/client/models/beta_web_key_service_list_web_keys_response.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaListWebKeysResponse + class BetaWebKeyServiceListWebKeysResponse attr_accessor :web_keys # Attribute mapping from ruby-style variable name to JSON key. @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'web_keys' => :'Array' + :'web_keys' => :'Array' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaListWebKeysResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceListWebKeysResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +60,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaListWebKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceListWebKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/zitadel/client/models/web_key_service_beta_state.rb b/lib/zitadel/client/models/beta_web_key_service_state.rb similarity index 90% rename from lib/zitadel/client/models/web_key_service_beta_state.rb rename to lib/zitadel/client/models/beta_web_key_service_state.rb index c659505e..537d6007 100644 --- a/lib/zitadel/client/models/web_key_service_beta_state.rb +++ b/lib/zitadel/client/models/beta_web_key_service_state.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaState + class BetaWebKeyServiceState STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze STATE_INITIAL = "STATE_INITIAL".freeze STATE_ACTIVE = "STATE_ACTIVE".freeze @@ -36,8 +36,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if WebKeyServiceBetaState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaState" + return value if BetaWebKeyServiceState.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaWebKeyServiceState" end end diff --git a/lib/zitadel/client/models/beta_web_key_service_web_key.rb b/lib/zitadel/client/models/beta_web_key_service_web_key.rb new file mode 100644 index 00000000..aef20f0c --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_web_key.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module BetaWebKeyServiceWebKey + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Ecdsa', + :'Ed25519', + :'Rsa' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/creation_date_query.rb b/lib/zitadel/client/models/creation_date_query.rb new file mode 100644 index 00000000..a852962d --- /dev/null +++ b/lib/zitadel/client/models/creation_date_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class CreationDateQuery + attr_accessor :creation_date_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'creation_date_query' => :'creationDateQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'creation_date_query' => :'BetaSessionServiceCreationDateQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::CreationDateQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::CreationDateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'creation_date_query') + self.creation_date_query = attributes[:'creation_date_query'] + else + self.creation_date_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @creation_date_query.nil? + invalid_properties.push('invalid value for "creation_date_query", creation_date_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @creation_date_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaSessionServiceCreationDateQuery] creation_date_query Value to be assigned + def creation_date_query=(creation_date_query) + if creation_date_query.nil? + fail ArgumentError, 'creation_date_query cannot be nil' + end + + @creation_date_query = creation_date_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + creation_date_query == o.creation_date_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [creation_date_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/creation_date_query1.rb b/lib/zitadel/client/models/creation_date_query1.rb new file mode 100644 index 00000000..a87a67ca --- /dev/null +++ b/lib/zitadel/client/models/creation_date_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class CreationDateQuery1 + attr_accessor :creation_date_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'creation_date_query' => :'creationDateQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'creation_date_query' => :'SessionServiceCreationDateQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::CreationDateQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::CreationDateQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'creation_date_query') + self.creation_date_query = attributes[:'creation_date_query'] + else + self.creation_date_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @creation_date_query.nil? + invalid_properties.push('invalid value for "creation_date_query", creation_date_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @creation_date_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [SessionServiceCreationDateQuery] creation_date_query Value to be assigned + def creation_date_query=(creation_date_query) + if creation_date_query.nil? + fail ArgumentError, 'creation_date_query cannot be nil' + end + + @creation_date_query = creation_date_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + creation_date_query == o.creation_date_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [creation_date_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/creator_query.rb b/lib/zitadel/client/models/creator_query.rb new file mode 100644 index 00000000..7ab1d7ca --- /dev/null +++ b/lib/zitadel/client/models/creator_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class CreatorQuery + attr_accessor :creator_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'creator_query' => :'creatorQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'creator_query' => :'SessionServiceCreatorQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::CreatorQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::CreatorQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'creator_query') + self.creator_query = attributes[:'creator_query'] + else + self.creator_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @creator_query.nil? + invalid_properties.push('invalid value for "creator_query", creator_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @creator_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [SessionServiceCreatorQuery] creator_query Value to be assigned + def creator_query=(creator_query) + if creator_query.nil? + fail ArgumentError, 'creator_query cannot be nil' + end + + @creator_query = creator_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + creator_query == o.creator_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [creator_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_organization_state_query.rb b/lib/zitadel/client/models/current_password.rb similarity index 86% rename from lib/zitadel/client/models/organization_service_organization_state_query.rb rename to lib/zitadel/client/models/current_password.rb index ccd127ed..a543330e 100644 --- a/lib/zitadel/client/models/organization_service_organization_state_query.rb +++ b/lib/zitadel/client/models/current_password.rb @@ -14,35 +14,13 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceOrganizationStateQuery - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end + class CurrentPassword + attr_accessor :current_password # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'state' => :'state' + :'current_password' => :'currentPassword' } end @@ -59,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'state' => :'OrganizationServiceOrganizationState' + :'current_password' => :'String' } end @@ -74,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganizationStateQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::CurrentPassword` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -82,15 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganizationStateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::CurrentPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'state') - self.state = attributes[:'state'] + if attributes.key?(:'current_password') + self.current_password = attributes[:'current_password'] else - self.state = 'ORGANIZATION_STATE_UNSPECIFIED' + self.current_password = nil end end @@ -99,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @current_password.nil? + invalid_properties.push('invalid value for "current_password", current_password cannot be nil.') + end + invalid_properties end @@ -106,15 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @current_password.nil? true end + # Custom attribute writer method with validation + # @param [String] current_password Value to be assigned + def current_password=(current_password) + if current_password.nil? + fail ArgumentError, 'current_password cannot be nil' + end + + @current_password = current_password + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - state == o.state + current_password == o.current_password end # @see the `==` method @@ -126,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [state].hash + [current_password].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/session_service_rpc_status.rb b/lib/zitadel/client/models/default_query.rb similarity index 86% rename from lib/zitadel/client/models/session_service_rpc_status.rb rename to lib/zitadel/client/models/default_query.rb index 39bc2f5c..368b95d9 100644 --- a/lib/zitadel/client/models/session_service_rpc_status.rb +++ b/lib/zitadel/client/models/default_query.rb @@ -14,19 +14,13 @@ require 'time' module Zitadel::Client::Models - class SessionServiceRpcStatus - attr_accessor :code - - attr_accessor :message - - attr_accessor :details + class DefaultQuery + attr_accessor :default_query # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'default_query' => :'defaultQuery' } end @@ -43,9 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'default_query' => :'OrganizationServiceDefaultOrganizationQuery' } end @@ -60,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::DefaultQuery` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,23 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::DefaultQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end + if attributes.key?(:'default_query') + self.default_query = attributes[:'default_query'] + else + self.default_query = nil end end @@ -93,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @default_query.nil? + invalid_properties.push('invalid value for "default_query", default_query cannot be nil.') + end + invalid_properties end @@ -100,17 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @default_query.nil? true end + # Custom attribute writer method with validation + # @param [OrganizationServiceDefaultOrganizationQuery] default_query Value to be assigned + def default_query=(default_query) + if default_query.nil? + fail ArgumentError, 'default_query cannot be nil' + end + + @default_query = default_query + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + default_query == o.default_query end # @see the `==` method @@ -122,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [default_query].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/o_i_d_c_service_authorize_or_deny_device_authorization_request.rb b/lib/zitadel/client/models/deny.rb similarity index 90% rename from lib/zitadel/client/models/o_i_d_c_service_authorize_or_deny_device_authorization_request.rb rename to lib/zitadel/client/models/deny.rb index ab1595f3..1443b006 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_authorize_or_deny_device_authorization_request.rb +++ b/lib/zitadel/client/models/deny.rb @@ -14,15 +14,12 @@ require 'time' module Zitadel::Client::Models - class OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest - attr_accessor :session - + class Deny attr_accessor :deny # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'session' => :'session', :'deny' => :'deny' } end @@ -40,8 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'session' => :'OIDCServiceSession', - :'deny' => :'Object' + :'deny' => :'OIDCServiceDeny' } end @@ -56,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Deny` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Deny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - if attributes.key?(:'deny') self.deny = attributes[:'deny'] + else + self.deny = nil end end @@ -83,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @deny.nil? + invalid_properties.push('invalid value for "deny", deny cannot be nil.') + end + invalid_properties end @@ -90,15 +88,25 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @deny.nil? true end + # Custom attribute writer method with validation + # @param [OIDCServiceDeny] deny Value to be assigned + def deny=(deny) + if deny.nil? + fail ArgumentError, 'deny cannot be nil' + end + + @deny = deny + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - session == o.session && deny == o.deny end @@ -111,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [session, deny].hash + [deny].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/display_name_query.rb b/lib/zitadel/client/models/display_name_query.rb new file mode 100644 index 00000000..9ef09738 --- /dev/null +++ b/lib/zitadel/client/models/display_name_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class DisplayNameQuery + attr_accessor :display_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'display_name_query' => :'displayNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'display_name_query' => :'UserServiceDisplayNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::DisplayNameQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::DisplayNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'display_name_query') + self.display_name_query = attributes[:'display_name_query'] + else + self.display_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @display_name_query.nil? + invalid_properties.push('invalid value for "display_name_query", display_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @display_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceDisplayNameQuery] display_name_query Value to be assigned + def display_name_query=(display_name_query) + if display_name_query.nil? + fail ArgumentError, 'display_name_query cannot be nil' + end + + @display_name_query = display_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name_query == o.display_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [display_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_create_target_response.rb b/lib/zitadel/client/models/display_name_query1.rb similarity index 84% rename from lib/zitadel/client/models/action_service_beta_create_target_response.rb rename to lib/zitadel/client/models/display_name_query1.rb index bd5ecf14..160db224 100644 --- a/lib/zitadel/client/models/action_service_beta_create_target_response.rb +++ b/lib/zitadel/client/models/display_name_query1.rb @@ -14,22 +14,13 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaCreateTargetResponse - # The unique identifier of the newly created target. - attr_accessor :id - - # The timestamp of the target creation. - attr_accessor :creation_date - - # Key used to sign and check payload sent to the target. - attr_accessor :signing_key + class DisplayNameQuery1 + attr_accessor :display_name_query # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'signing_key' => :'signingKey' + :'display_name_query' => :'displayNameQuery' } end @@ -46,9 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - :'creation_date' => :'Time', - :'signing_key' => :'String' + :'display_name_query' => :'BetaUserServiceDisplayNameQuery' } end @@ -63,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaCreateTargetResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::DisplayNameQuery1` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -71,21 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaCreateTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::DisplayNameQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'signing_key') - self.signing_key = attributes[:'signing_key'] + if attributes.key?(:'display_name_query') + self.display_name_query = attributes[:'display_name_query'] + else + self.display_name_query = nil end end @@ -94,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @display_name_query.nil? + invalid_properties.push('invalid value for "display_name_query", display_name_query cannot be nil.') + end + invalid_properties end @@ -101,17 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @display_name_query.nil? true end + # Custom attribute writer method with validation + # @param [BetaUserServiceDisplayNameQuery] display_name_query Value to be assigned + def display_name_query=(display_name_query) + if display_name_query.nil? + fail ArgumentError, 'display_name_query cannot be nil' + end + + @display_name_query = display_name_query + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - id == o.id && - creation_date == o.creation_date && - signing_key == o.signing_key + display_name_query == o.display_name_query end # @see the `==` method @@ -123,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, creation_date, signing_key].hash + [display_name_query].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/domain_query.rb b/lib/zitadel/client/models/domain_query.rb new file mode 100644 index 00000000..dfc77a72 --- /dev/null +++ b/lib/zitadel/client/models/domain_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class DomainQuery + attr_accessor :domain_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'domain_query' => :'domainQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'domain_query' => :'OrganizationServiceOrganizationDomainQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::DomainQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::DomainQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'domain_query') + self.domain_query = attributes[:'domain_query'] + else + self.domain_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @domain_query.nil? + invalid_properties.push('invalid value for "domain_query", domain_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @domain_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [OrganizationServiceOrganizationDomainQuery] domain_query Value to be assigned + def domain_query=(domain_query) + if domain_query.nil? + fail ArgumentError, 'domain_query cannot be nil' + end + + @domain_query = domain_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + domain_query == o.domain_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [domain_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/ecdsa.rb b/lib/zitadel/client/models/ecdsa.rb new file mode 100644 index 00000000..97dc10c9 --- /dev/null +++ b/lib/zitadel/client/models/ecdsa.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Ecdsa + attr_accessor :ecdsa + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ecdsa' => :'ecdsa' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ecdsa' => :'BetaWebKeyServiceECDSA' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Ecdsa` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Ecdsa`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ecdsa') + self.ecdsa = attributes[:'ecdsa'] + else + self.ecdsa = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ecdsa.nil? + invalid_properties.push('invalid value for "ecdsa", ecdsa cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ecdsa.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaWebKeyServiceECDSA] ecdsa Value to be assigned + def ecdsa=(ecdsa) + if ecdsa.nil? + fail ArgumentError, 'ecdsa cannot be nil' + end + + @ecdsa = ecdsa + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ecdsa == o.ecdsa + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ecdsa].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/web_key_service_create_web_key_request.rb b/lib/zitadel/client/models/ed25519.rb similarity index 89% rename from lib/zitadel/client/models/web_key_service_create_web_key_request.rb rename to lib/zitadel/client/models/ed25519.rb index ac528743..c31e7ad2 100644 --- a/lib/zitadel/client/models/web_key_service_create_web_key_request.rb +++ b/lib/zitadel/client/models/ed25519.rb @@ -14,18 +14,12 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceCreateWebKeyRequest - attr_accessor :rsa - - attr_accessor :ecdsa - + class Ed25519 attr_accessor :ed25519 # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'rsa' => :'rsa', - :'ecdsa' => :'ecdsa', :'ed25519' => :'ed25519' } end @@ -43,9 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'rsa' => :'WebKeyServiceBetaRSA', - :'ecdsa' => :'WebKeyServiceBetaECDSA', - :'ed25519' => :'Object' + :'ed25519' => :'BetaWebKeyServiceED25519' } end @@ -60,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceCreateWebKeyRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Ed25519` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,21 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceCreateWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Ed25519`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'rsa') - self.rsa = attributes[:'rsa'] - end - - if attributes.key?(:'ecdsa') - self.ecdsa = attributes[:'ecdsa'] - end - if attributes.key?(:'ed25519') self.ed25519 = attributes[:'ed25519'] + else + self.ed25519 = nil end end @@ -91,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @ed25519.nil? + invalid_properties.push('invalid value for "ed25519", ed25519 cannot be nil.') + end + invalid_properties end @@ -98,16 +88,25 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ed25519.nil? true end + # Custom attribute writer method with validation + # @param [BetaWebKeyServiceED25519] ed25519 Value to be assigned + def ed25519=(ed25519) + if ed25519.nil? + fail ArgumentError, 'ed25519 cannot be nil' + end + + @ed25519 = ed25519 + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - rsa == o.rsa && - ecdsa == o.ecdsa && ed25519 == o.ed25519 end @@ -120,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [rsa, ecdsa, ed25519].hash + [ed25519].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/email_query.rb b/lib/zitadel/client/models/email_query.rb new file mode 100644 index 00000000..421b1f20 --- /dev/null +++ b/lib/zitadel/client/models/email_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class EmailQuery + attr_accessor :email_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'email_query' => :'emailQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'email_query' => :'UserServiceEmailQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::EmailQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::EmailQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'email_query') + self.email_query = attributes[:'email_query'] + else + self.email_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @email_query.nil? + invalid_properties.push('invalid value for "email_query", email_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @email_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceEmailQuery] email_query Value to be assigned + def email_query=(email_query) + if email_query.nil? + fail ArgumentError, 'email_query cannot be nil' + end + + @email_query = email_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + email_query == o.email_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [email_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a.rb b/lib/zitadel/client/models/email_query1.rb similarity index 86% rename from lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a.rb rename to lib/zitadel/client/models/email_query1.rb index 00f8cf5d..e7ea1ed6 100644 --- a/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a.rb +++ b/lib/zitadel/client/models/email_query1.rb @@ -14,35 +14,13 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaECDSA - attr_accessor :curve - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end + class EmailQuery1 + attr_accessor :email_query # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'curve' => :'curve' + :'email_query' => :'emailQuery' } end @@ -59,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'curve' => :'WebKeyServiceBetaECDSACurve' + :'email_query' => :'BetaUserServiceEmailQuery' } end @@ -74,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaECDSA` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::EmailQuery1` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -82,15 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaECDSA`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::EmailQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'curve') - self.curve = attributes[:'curve'] + if attributes.key?(:'email_query') + self.email_query = attributes[:'email_query'] else - self.curve = 'ECDSA_CURVE_UNSPECIFIED' + self.email_query = nil end end @@ -99,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @email_query.nil? + invalid_properties.push('invalid value for "email_query", email_query cannot be nil.') + end + invalid_properties end @@ -106,15 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @email_query.nil? true end + # Custom attribute writer method with validation + # @param [BetaUserServiceEmailQuery] email_query Value to be assigned + def email_query=(email_query) + if email_query.nil? + fail ArgumentError, 'email_query cannot be nil' + end + + @email_query = email_query + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - curve == o.curve + email_query == o.email_query end # @see the `==` method @@ -126,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [curve].hash + [email_query].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/o_i_d_c_service_create_callback_request.rb b/lib/zitadel/client/models/error.rb similarity index 91% rename from lib/zitadel/client/models/o_i_d_c_service_create_callback_request.rb rename to lib/zitadel/client/models/error.rb index 90d9fa82..9d8429aa 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_create_callback_request.rb +++ b/lib/zitadel/client/models/error.rb @@ -14,15 +14,12 @@ require 'time' module Zitadel::Client::Models - class OIDCServiceCreateCallbackRequest - attr_accessor :session - + class Error attr_accessor :error # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'session' => :'session', :'error' => :'error' } end @@ -40,7 +37,6 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'session' => :'OIDCServiceSession', :'error' => :'OIDCServiceAuthorizationError' } end @@ -56,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceCreateCallbackRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Error` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceCreateCallbackRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - if attributes.key?(:'error') self.error = attributes[:'error'] + else + self.error = nil end end @@ -83,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @error.nil? + invalid_properties.push('invalid value for "error", error cannot be nil.') + end + invalid_properties end @@ -90,15 +88,25 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @error.nil? true end + # Custom attribute writer method with validation + # @param [OIDCServiceAuthorizationError] error Value to be assigned + def error=(error) + if error.nil? + fail ArgumentError, 'error cannot be nil' + end + + @error = error + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - session == o.session && error == o.error end @@ -111,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [session, error].hash + [error].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/s_a_m_l_service_create_response_request.rb b/lib/zitadel/client/models/error1.rb similarity index 91% rename from lib/zitadel/client/models/s_a_m_l_service_create_response_request.rb rename to lib/zitadel/client/models/error1.rb index 1bd0a70b..d09f2723 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_create_response_request.rb +++ b/lib/zitadel/client/models/error1.rb @@ -14,15 +14,12 @@ require 'time' module Zitadel::Client::Models - class SAMLServiceCreateResponseRequest - attr_accessor :session - + class Error1 attr_accessor :error # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'session' => :'session', :'error' => :'error' } end @@ -40,7 +37,6 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'session' => :'SAMLServiceSession', :'error' => :'SAMLServiceAuthorizationError' } end @@ -56,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceCreateResponseRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Error1` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceCreateResponseRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Error1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - if attributes.key?(:'error') self.error = attributes[:'error'] + else + self.error = nil end end @@ -83,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @error.nil? + invalid_properties.push('invalid value for "error", error cannot be nil.') + end + invalid_properties end @@ -90,15 +88,25 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @error.nil? true end + # Custom attribute writer method with validation + # @param [SAMLServiceAuthorizationError] error Value to be assigned + def error=(error) + if error.nil? + fail ArgumentError, 'error cannot be nil' + end + + @error = error + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - session == o.session && error == o.error end @@ -111,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [session, error].hash + [error].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/error2.rb b/lib/zitadel/client/models/error2.rb new file mode 100644 index 00000000..42149fa7 --- /dev/null +++ b/lib/zitadel/client/models/error2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Error2 + attr_accessor :error + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error' => :'error' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'error' => :'BetaOIDCServiceAuthorizationError' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Error2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Error2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + else + self.error = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @error.nil? + invalid_properties.push('invalid value for "error", error cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @error.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaOIDCServiceAuthorizationError] error Value to be assigned + def error=(error) + if error.nil? + fail ArgumentError, 'error cannot be nil' + end + + @error = error + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [error].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/event.rb b/lib/zitadel/client/models/event.rb new file mode 100644 index 00000000..777a8ef2 --- /dev/null +++ b/lib/zitadel/client/models/event.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Event + attr_accessor :event + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event' => :'event' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'event' => :'BetaActionServiceEventExecution' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Event` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Event`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'event') + self.event = attributes[:'event'] + else + self.event = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @event.nil? + invalid_properties.push('invalid value for "event", event cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @event.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceEventExecution] event Value to be assigned + def event=(event) + if event.nil? + fail ArgumentError, 'event cannot be nil' + end + + @event = event + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event == o.event + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [event].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/execution_type_filter.rb b/lib/zitadel/client/models/execution_type_filter.rb new file mode 100644 index 00000000..3cea3054 --- /dev/null +++ b/lib/zitadel/client/models/execution_type_filter.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ExecutionTypeFilter + attr_accessor :execution_type_filter + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'execution_type_filter' => :'executionTypeFilter' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'execution_type_filter' => :'BetaActionServiceExecutionTypeFilter' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ExecutionTypeFilter` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ExecutionTypeFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'execution_type_filter') + self.execution_type_filter = attributes[:'execution_type_filter'] + else + self.execution_type_filter = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @execution_type_filter.nil? + invalid_properties.push('invalid value for "execution_type_filter", execution_type_filter cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @execution_type_filter.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceExecutionTypeFilter] execution_type_filter Value to be assigned + def execution_type_filter=(execution_type_filter) + if execution_type_filter.nil? + fail ArgumentError, 'execution_type_filter cannot be nil' + end + + @execution_type_filter = execution_type_filter + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + execution_type_filter == o.execution_type_filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [execution_type_filter].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_any.rb b/lib/zitadel/client/models/feature_service_any.rb new file mode 100644 index 00000000..71dfcab6 --- /dev/null +++ b/lib/zitadel/client/models/feature_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class FeatureServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_connect_error.rb b/lib/zitadel/client/models/feature_service_connect_error.rb new file mode 100644 index 00000000..f4845aed --- /dev/null +++ b/lib/zitadel/client/models/feature_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class FeatureServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'FeatureServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_details.rb b/lib/zitadel/client/models/feature_service_details.rb index fb5b596a..a5fc4744 100644 --- a/lib/zitadel/client/models/feature_service_details.rb +++ b/lib/zitadel/client/models/feature_service_details.rb @@ -15,14 +15,16 @@ module Zitadel::Client::Models class FeatureServiceDetails - # on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation attr_accessor :sequence - # on read: the timestamp of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date + # resource_owner is the organization or instance_id an object belongs to attr_accessor :resource_owner + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date # Attribute mapping from ruby-style variable name to JSON key. @@ -48,7 +50,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'sequence' => :'String', + :'sequence' => :'Object', :'change_date' => :'Time', :'resource_owner' => :'String', :'creation_date' => :'Time' @@ -58,6 +60,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/feature_service_feature_flag.rb b/lib/zitadel/client/models/feature_service_feature_flag.rb index dbbaef8b..d6ba6279 100644 --- a/lib/zitadel/client/models/feature_service_feature_flag.rb +++ b/lib/zitadel/client/models/feature_service_feature_flag.rb @@ -16,7 +16,6 @@ module Zitadel::Client::Models # FeatureFlag is a simple boolean Feature setting, without further payload. class FeatureServiceFeatureFlag - # Whether a feature is enabled. attr_accessor :enabled attr_accessor :source @@ -99,8 +98,6 @@ def initialize(attributes = {}) if attributes.key?(:'source') self.source = attributes[:'source'] - else - self.source = 'SOURCE_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/feature_service_get_instance_features_request.rb b/lib/zitadel/client/models/feature_service_get_instance_features_request.rb new file mode 100644 index 00000000..0a810b2b --- /dev/null +++ b/lib/zitadel/client/models/feature_service_get_instance_features_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class FeatureServiceGetInstanceFeaturesRequest + attr_accessor :inheritance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'inheritance' => :'inheritance' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'inheritance' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetInstanceFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetInstanceFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'inheritance') + self.inheritance = attributes[:'inheritance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + inheritance == o.inheritance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [inheritance].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_get_organization_features_request.rb b/lib/zitadel/client/models/feature_service_get_organization_features_request.rb new file mode 100644 index 00000000..f47bbcc7 --- /dev/null +++ b/lib/zitadel/client/models/feature_service_get_organization_features_request.rb @@ -0,0 +1,239 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class FeatureServiceGetOrganizationFeaturesRequest + attr_accessor :organization_id + + attr_accessor :inheritance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId', + :'inheritance' => :'inheritance' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'String', + :'inheritance' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetOrganizationFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'inheritance') + self.inheritance = attributes[:'inheritance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id && + inheritance == o.inheritance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id, inheritance].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_i_d_p_o_auth_access_information.rb b/lib/zitadel/client/models/feature_service_get_user_features_request.rb similarity index 90% rename from lib/zitadel/client/models/user_service_i_d_p_o_auth_access_information.rb rename to lib/zitadel/client/models/feature_service_get_user_features_request.rb index 5be6b497..e59e2eea 100644 --- a/lib/zitadel/client/models/user_service_i_d_p_o_auth_access_information.rb +++ b/lib/zitadel/client/models/feature_service_get_user_features_request.rb @@ -14,16 +14,16 @@ require 'time' module Zitadel::Client::Models - class UserServiceIDPOAuthAccessInformation - attr_accessor :access_token + class FeatureServiceGetUserFeaturesRequest + attr_accessor :user_id - attr_accessor :id_token + attr_accessor :inheritance # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'access_token' => :'accessToken', - :'id_token' => :'idToken' + :'user_id' => :'userId', + :'inheritance' => :'inheritance' } end @@ -40,8 +40,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'access_token' => :'String', - :'id_token' => :'String' + :'user_id' => :'String', + :'inheritance' => :'Boolean' } end @@ -56,7 +56,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPOAuthAccessInformation` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetUserFeaturesRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +64,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPOAuthAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetUserFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] end - if attributes.key?(:'id_token') - self.id_token = attributes[:'id_token'] + if attributes.key?(:'inheritance') + self.inheritance = attributes[:'inheritance'] end end @@ -98,8 +98,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - access_token == o.access_token && - id_token == o.id_token + user_id == o.user_id && + inheritance == o.inheritance end # @see the `==` method @@ -111,7 +111,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [access_token, id_token].hash + [user_id, inheritance].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb b/lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb index 6f35b41e..970d351a 100644 --- a/lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb +++ b/lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb @@ -15,7 +15,6 @@ module Zitadel::Client::Models class FeatureServiceImprovedPerformanceFeatureFlag - # Which of the performance improvements is enabled attr_accessor :execution_paths attr_accessor :source @@ -100,8 +99,6 @@ def initialize(attributes = {}) if attributes.key?(:'source') self.source = attributes[:'source'] - else - self.source = 'SOURCE_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/feature_service_login_v2.rb b/lib/zitadel/client/models/feature_service_login_v2.rb index 32360ab8..b3b0886c 100644 --- a/lib/zitadel/client/models/feature_service_login_v2.rb +++ b/lib/zitadel/client/models/feature_service_login_v2.rb @@ -50,6 +50,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'base_uri' ]) end diff --git a/lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb b/lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb index e61c5597..75d019f6 100644 --- a/lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb +++ b/lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb @@ -74,6 +74,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'base_uri', ]) end @@ -105,8 +106,6 @@ def initialize(attributes = {}) if attributes.key?(:'source') self.source = attributes[:'source'] - else - self.source = 'SOURCE_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/feature_service_reset_organization_features_request.rb b/lib/zitadel/client/models/feature_service_reset_organization_features_request.rb new file mode 100644 index 00000000..30531482 --- /dev/null +++ b/lib/zitadel/client/models/feature_service_reset_organization_features_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class FeatureServiceResetOrganizationFeaturesRequest + attr_accessor :organization_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceResetOrganizationFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceResetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_reset_user_features_request.rb b/lib/zitadel/client/models/feature_service_reset_user_features_request.rb new file mode 100644 index 00000000..bdd47a04 --- /dev/null +++ b/lib/zitadel/client/models/feature_service_reset_user_features_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class FeatureServiceResetUserFeaturesRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceResetUserFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceResetUserFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_set_instance_features_request.rb b/lib/zitadel/client/models/feature_service_set_instance_features_request.rb index c009abef..cff42312 100644 --- a/lib/zitadel/client/models/feature_service_set_instance_features_request.rb +++ b/lib/zitadel/client/models/feature_service_set_instance_features_request.rb @@ -15,45 +15,32 @@ module Zitadel::Client::Models class FeatureServiceSetInstanceFeaturesRequest - # The login UI will use the settings of the default org (and not from the instance) if no organization context is set attr_accessor :login_default_org - # Enable projection triggers during an introspection request. This can act as workaround if there are noticeable consistency issues in the introspection response but can have an impact on performance. We are planning to remove triggers for introspection requests in the future. Please raise an issue if you needed to enable this feature. attr_accessor :oidc_trigger_introspection_projections - # We have recently refactored the introspection endpoint for performance reasons. This feature can be used to rollback to the legacy implementation if unexpected bugs arise. Please raise an issue if you needed to enable this feature. attr_accessor :oidc_legacy_introspection - # User Schemas allow to manage data schemas of user. If the flag is enabled, you'll be able to use the new API and its features. Note that it is still in an early stage. attr_accessor :user_schema - # Enable the experimental `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. attr_accessor :oidc_token_exchange - # Improves performance of specified execution paths. attr_accessor :improved_performance - # Enable the webkey/v3alpha API. The first time this feature is enabled, web keys are generated and activated. attr_accessor :web_key - # Return parent errors to OIDC clients for debugging purposes. Parent errors may contain sensitive data or unwanted details about the system status of zitadel. Only enable if really needed. attr_accessor :debug_oidc_parent_error - # If the flag is enabled, you'll be able to terminate a single session from the login UI by providing an id_token with a `sid` claim as id_token_hint on the end_session endpoint. Note that currently all sessions from the same user agent (browser) are terminated in the login UI. Sessions managed through the Session API already allow the termination of single sessions. attr_accessor :oidc_single_v1_session_termination - # Do not push user token meta-event user.token.v2.added to improve performance on many concurrent single (machine-)user logins attr_accessor :disable_user_token_event - # If the flag is enabled, you'll be able to use the OIDC Back-Channel Logout to be notified in your application about terminated user sessions. attr_accessor :enable_back_channel_logout attr_accessor :login_v2 - # Enable a newer, more performant, permission check used for v2 and v3 resource based APIs. attr_accessor :permission_check_v2 - # If this is enabled the console web client will use the new User v2 API for certain calls attr_accessor :console_use_v2_user_api # Attribute mapping from ruby-style variable name to JSON key. @@ -109,6 +96,18 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'login_default_org', + :'oidc_trigger_introspection_projections', + :'oidc_legacy_introspection', + :'user_schema', + :'oidc_token_exchange', + :'web_key', + :'debug_oidc_parent_error', + :'oidc_single_v1_session_termination', + :'disable_user_token_event', + :'enable_back_channel_logout', + :'permission_check_v2', + :'console_use_v2_user_api' ]) end diff --git a/lib/zitadel/client/models/feature_service_set_organization_features_request.rb b/lib/zitadel/client/models/feature_service_set_organization_features_request.rb new file mode 100644 index 00000000..63a7b545 --- /dev/null +++ b/lib/zitadel/client/models/feature_service_set_organization_features_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class FeatureServiceSetOrganizationFeaturesRequest + attr_accessor :organization_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organization_id' => :'organizationId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'organization_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetOrganizationFeaturesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organization_id == o.organization_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organization_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/feature_service_set_system_features_request.rb b/lib/zitadel/client/models/feature_service_set_system_features_request.rb index aba2bc8a..2f407c9c 100644 --- a/lib/zitadel/client/models/feature_service_set_system_features_request.rb +++ b/lib/zitadel/client/models/feature_service_set_system_features_request.rb @@ -15,36 +15,26 @@ module Zitadel::Client::Models class FeatureServiceSetSystemFeaturesRequest - # The login UI will use the settings of the default org (and not from the instance) if no organization context is set attr_accessor :login_default_org - # Enable projection triggers during an introspection request. This can act as workaround if there are noticeable consistency issues in the introspection response but can have an impact on performance. We are planning to remove triggers for introspection requests in the future. Please raise an issue if you needed to enable this feature. attr_accessor :oidc_trigger_introspection_projections - # We have recently refactored the introspection endpoint for performance reasons. This feature can be used to rollback to the legacy implementation if unexpected bugs arise. Please raise an issue if you needed to enable this feature. attr_accessor :oidc_legacy_introspection - # User Schemas allow to manage data schemas of user. If the flag is enabled, you'll be able to use the new API and its features. Note that it is still in an early stage. attr_accessor :user_schema - # Enable the experimental `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. attr_accessor :oidc_token_exchange - # Improves performance of specified execution paths. attr_accessor :improved_performance - # If the flag is enabled, you'll be able to terminate a single session from the login UI by providing an id_token with a `sid` claim as id_token_hint on the end_session endpoint. Note that currently all sessions from the same user agent (browser) are terminated in the login UI. Sessions managed through the Session API already allow the termination of single sessions. attr_accessor :oidc_single_v1_session_termination - # Do not push user token meta-event user.token.v2.added to improve performance on many concurrent single (machine-)user logins attr_accessor :disable_user_token_event - # If the flag is enabled, you'll be able to use the OIDC Back-Channel Logout to be notified in your application about terminated user sessions. attr_accessor :enable_back_channel_logout attr_accessor :login_v2 - # Enable a newer, more performant, permission check used for v2 and v3 resource based APIs. attr_accessor :permission_check_v2 # Attribute mapping from ruby-style variable name to JSON key. @@ -94,6 +84,15 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'login_default_org', + :'oidc_trigger_introspection_projections', + :'oidc_legacy_introspection', + :'user_schema', + :'oidc_token_exchange', + :'oidc_single_v1_session_termination', + :'disable_user_token_event', + :'enable_back_channel_logout', + :'permission_check_v2' ]) end diff --git a/lib/zitadel/client/models/user_service_i_d_p_l_d_a_p_access_information.rb b/lib/zitadel/client/models/feature_service_set_user_feature_request.rb similarity index 93% rename from lib/zitadel/client/models/user_service_i_d_p_l_d_a_p_access_information.rb rename to lib/zitadel/client/models/feature_service_set_user_feature_request.rb index d35ecb6d..98260078 100644 --- a/lib/zitadel/client/models/user_service_i_d_p_l_d_a_p_access_information.rb +++ b/lib/zitadel/client/models/feature_service_set_user_feature_request.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class UserServiceIDPLDAPAccessInformation - attr_accessor :attributes + class FeatureServiceSetUserFeatureRequest + attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'attributes' => :'attributes' + :'user_id' => :'userId' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'attributes' => :'Object' + :'user_id' => :'String' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPLDAPAccessInformation` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetUserFeatureRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPLDAPAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetUserFeatureRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - attributes == o.attributes + user_id == o.user_id end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [attributes].hash + [user_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/first_name_query.rb b/lib/zitadel/client/models/first_name_query.rb new file mode 100644 index 00000000..03d82df2 --- /dev/null +++ b/lib/zitadel/client/models/first_name_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class FirstNameQuery + attr_accessor :first_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'first_name_query' => :'firstNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'first_name_query' => :'UserServiceFirstNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FirstNameQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FirstNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'first_name_query') + self.first_name_query = attributes[:'first_name_query'] + else + self.first_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @first_name_query.nil? + invalid_properties.push('invalid value for "first_name_query", first_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @first_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceFirstNameQuery] first_name_query Value to be assigned + def first_name_query=(first_name_query) + if first_name_query.nil? + fail ArgumentError, 'first_name_query cannot be nil' + end + + @first_name_query = first_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + first_name_query == o.first_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [first_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/first_name_query1.rb b/lib/zitadel/client/models/first_name_query1.rb new file mode 100644 index 00000000..e4920c71 --- /dev/null +++ b/lib/zitadel/client/models/first_name_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class FirstNameQuery1 + attr_accessor :first_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'first_name_query' => :'firstNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'first_name_query' => :'BetaUserServiceFirstNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FirstNameQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FirstNameQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'first_name_query') + self.first_name_query = attributes[:'first_name_query'] + else + self.first_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @first_name_query.nil? + invalid_properties.push('invalid value for "first_name_query", first_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @first_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceFirstNameQuery] first_name_query Value to be assigned + def first_name_query=(first_name_query) + if first_name_query.nil? + fail ArgumentError, 'first_name_query cannot be nil' + end + + @first_name_query = first_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + first_name_query == o.first_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [first_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/function.rb b/lib/zitadel/client/models/function.rb new file mode 100644 index 00000000..8bb48f98 --- /dev/null +++ b/lib/zitadel/client/models/function.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Function + attr_accessor :function + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'function' => :'function' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'function' => :'BetaActionServiceFunctionExecution' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Function` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Function`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'function') + self.function = attributes[:'function'] + else + self.function = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @function.nil? + invalid_properties.push('invalid value for "function", function cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @function.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceFunctionExecution] function Value to be assigned + def function=(function) + if function.nil? + fail ArgumentError, 'function cannot be nil' + end + + @function = function + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + function == o.function + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [function].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/github.rb b/lib/zitadel/client/models/github.rb new file mode 100644 index 00000000..4e58735f --- /dev/null +++ b/lib/zitadel/client/models/github.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Github + attr_accessor :github + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'github' => :'github' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'github' => :'IdentityProviderServiceGitHubConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Github` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Github`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'github') + self.github = attributes[:'github'] + else + self.github = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @github.nil? + invalid_properties.push('invalid value for "github", github cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @github.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceGitHubConfig] github Value to be assigned + def github=(github) + if github.nil? + fail ArgumentError, 'github cannot be nil' + end + + @github = github + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + github == o.github + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [github].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/github_es.rb b/lib/zitadel/client/models/github_es.rb new file mode 100644 index 00000000..b9b62a6c --- /dev/null +++ b/lib/zitadel/client/models/github_es.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class GithubEs + attr_accessor :github_es + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'github_es' => :'githubEs' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'github_es' => :'IdentityProviderServiceGitHubEnterpriseServerConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::GithubEs` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::GithubEs`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'github_es') + self.github_es = attributes[:'github_es'] + else + self.github_es = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @github_es.nil? + invalid_properties.push('invalid value for "github_es", github_es cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @github_es.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceGitHubEnterpriseServerConfig] github_es Value to be assigned + def github_es=(github_es) + if github_es.nil? + fail ArgumentError, 'github_es cannot be nil' + end + + @github_es = github_es + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + github_es == o.github_es + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [github_es].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/gitlab.rb b/lib/zitadel/client/models/gitlab.rb new file mode 100644 index 00000000..2bd60a64 --- /dev/null +++ b/lib/zitadel/client/models/gitlab.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Gitlab + attr_accessor :gitlab + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'gitlab' => :'gitlab' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'gitlab' => :'IdentityProviderServiceGitLabConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Gitlab` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Gitlab`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'gitlab') + self.gitlab = attributes[:'gitlab'] + else + self.gitlab = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @gitlab.nil? + invalid_properties.push('invalid value for "gitlab", gitlab cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @gitlab.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceGitLabConfig] gitlab Value to be assigned + def gitlab=(gitlab) + if gitlab.nil? + fail ArgumentError, 'gitlab cannot be nil' + end + + @gitlab = gitlab + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + gitlab == o.gitlab + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [gitlab].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/gitlab_self_hosted.rb b/lib/zitadel/client/models/gitlab_self_hosted.rb new file mode 100644 index 00000000..4d2ae8b9 --- /dev/null +++ b/lib/zitadel/client/models/gitlab_self_hosted.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class GitlabSelfHosted + attr_accessor :gitlab_self_hosted + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'gitlab_self_hosted' => :'gitlabSelfHosted' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'gitlab_self_hosted' => :'IdentityProviderServiceGitLabSelfHostedConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::GitlabSelfHosted` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::GitlabSelfHosted`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'gitlab_self_hosted') + self.gitlab_self_hosted = attributes[:'gitlab_self_hosted'] + else + self.gitlab_self_hosted = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @gitlab_self_hosted.nil? + invalid_properties.push('invalid value for "gitlab_self_hosted", gitlab_self_hosted cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @gitlab_self_hosted.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceGitLabSelfHostedConfig] gitlab_self_hosted Value to be assigned + def gitlab_self_hosted=(gitlab_self_hosted) + if gitlab_self_hosted.nil? + fail ArgumentError, 'gitlab_self_hosted cannot be nil' + end + + @gitlab_self_hosted = gitlab_self_hosted + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + gitlab_self_hosted == o.gitlab_self_hosted + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [gitlab_self_hosted].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/google.rb b/lib/zitadel/client/models/google.rb new file mode 100644 index 00000000..a52ad60a --- /dev/null +++ b/lib/zitadel/client/models/google.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Google + attr_accessor :google + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'google' => :'google' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'google' => :'IdentityProviderServiceGoogleConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Google` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Google`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'google') + self.google = attributes[:'google'] + else + self.google = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @google.nil? + invalid_properties.push('invalid value for "google", google cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @google.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceGoogleConfig] google Value to be assigned + def google=(google) + if google.nil? + fail ArgumentError, 'google cannot be nil' + end + + @google = google + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + google == o.google + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [google].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/hashed_password.rb b/lib/zitadel/client/models/hashed_password.rb new file mode 100644 index 00000000..4a5a9ec0 --- /dev/null +++ b/lib/zitadel/client/models/hashed_password.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class HashedPassword + attr_accessor :hashed_password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'hashed_password' => :'hashedPassword' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'hashed_password' => :'UserServiceHashedPassword' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::HashedPassword` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::HashedPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'hashed_password') + self.hashed_password = attributes[:'hashed_password'] + else + self.hashed_password = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @hashed_password.nil? + invalid_properties.push('invalid value for "hashed_password", hashed_password cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @hashed_password.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceHashedPassword] hashed_password Value to be assigned + def hashed_password=(hashed_password) + if hashed_password.nil? + fail ArgumentError, 'hashed_password cannot be nil' + end + + @hashed_password = hashed_password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + hashed_password == o.hashed_password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [hashed_password].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/hashed_password1.rb b/lib/zitadel/client/models/hashed_password1.rb new file mode 100644 index 00000000..c5c05911 --- /dev/null +++ b/lib/zitadel/client/models/hashed_password1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class HashedPassword1 + attr_accessor :hashed_password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'hashed_password' => :'hashedPassword' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'hashed_password' => :'BetaUserServiceHashedPassword' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::HashedPassword1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::HashedPassword1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'hashed_password') + self.hashed_password = attributes[:'hashed_password'] + else + self.hashed_password = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @hashed_password.nil? + invalid_properties.push('invalid value for "hashed_password", hashed_password cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @hashed_password.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceHashedPassword] hashed_password Value to be assigned + def hashed_password=(hashed_password) + if hashed_password.nil? + fail ArgumentError, 'hashed_password cannot be nil' + end + + @hashed_password = hashed_password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + hashed_password == o.hashed_password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [hashed_password].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/human.rb b/lib/zitadel/client/models/human.rb new file mode 100644 index 00000000..ce978d87 --- /dev/null +++ b/lib/zitadel/client/models/human.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Human + attr_accessor :human + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'human' => :'human' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'human' => :'OrganizationServiceAddHumanUserRequest' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Human` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Human`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'human') + self.human = attributes[:'human'] + else + self.human = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @human.nil? + invalid_properties.push('invalid value for "human", human cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @human.nil? + true + end + + # Custom attribute writer method with validation + # @param [OrganizationServiceAddHumanUserRequest] human Value to be assigned + def human=(human) + if human.nil? + fail ArgumentError, 'human cannot be nil' + end + + @human = human + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + human == o.human + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [human].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/human1.rb b/lib/zitadel/client/models/human1.rb new file mode 100644 index 00000000..50a5f14d --- /dev/null +++ b/lib/zitadel/client/models/human1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Human1 + attr_accessor :human + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'human' => :'human' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'human' => :'BetaUserServiceHumanUser' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Human1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Human1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'human') + self.human = attributes[:'human'] + else + self.human = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @human.nil? + invalid_properties.push('invalid value for "human", human cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @human.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceHumanUser] human Value to be assigned + def human=(human) + if human.nil? + fail ArgumentError, 'human cannot be nil' + end + + @human = human + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + human == o.human + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [human].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/human2.rb b/lib/zitadel/client/models/human2.rb new file mode 100644 index 00000000..9ed2c681 --- /dev/null +++ b/lib/zitadel/client/models/human2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Human2 + attr_accessor :human + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'human' => :'human' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'human' => :'BetaOrganizationServiceAddHumanUserRequest' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Human2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Human2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'human') + self.human = attributes[:'human'] + else + self.human = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @human.nil? + invalid_properties.push('invalid value for "human", human cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @human.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaOrganizationServiceAddHumanUserRequest] human Value to be assigned + def human=(human) + if human.nil? + fail ArgumentError, 'human cannot be nil' + end + + @human = human + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + human == o.human + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [human].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/id_query.rb b/lib/zitadel/client/models/id_query.rb new file mode 100644 index 00000000..8671a52a --- /dev/null +++ b/lib/zitadel/client/models/id_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class IdQuery + attr_accessor :id_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id_query' => :'idQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id_query' => :'OrganizationServiceOrganizationIDQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id_query') + self.id_query = attributes[:'id_query'] + else + self.id_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id_query.nil? + invalid_properties.push('invalid value for "id_query", id_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [OrganizationServiceOrganizationIDQuery] id_query Value to be assigned + def id_query=(id_query) + if id_query.nil? + fail ArgumentError, 'id_query cannot be nil' + end + + @id_query = id_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id_query == o.id_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_rpc_status.rb b/lib/zitadel/client/models/identity_provider_service_any.rb similarity index 87% rename from lib/zitadel/client/models/identity_provider_service_rpc_status.rb rename to lib/zitadel/client/models/identity_provider_service_any.rb index ac1d7555..840b3e00 100644 --- a/lib/zitadel/client/models/identity_provider_service_rpc_status.rb +++ b/lib/zitadel/client/models/identity_provider_service_any.rb @@ -14,19 +14,20 @@ require 'time' module Zitadel::Client::Models - class IdentityProviderServiceRpcStatus - attr_accessor :code + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class IdentityProviderServiceAny + attr_accessor :type - attr_accessor :message + attr_accessor :value - attr_accessor :details + attr_accessor :debug # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' } end @@ -43,9 +44,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' } end @@ -60,7 +61,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceAny` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,22 +69,22 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] + if attributes.key?(:'type') + self.type = attributes[:'type'] end - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'value') + self.value = attributes[:'value'] end - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value end end end @@ -108,9 +109,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + type == o.type && + value == o.value && + debug == o.debug end # @see the `==` method @@ -122,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [type, value, debug].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/identity_provider_service_apple_config.rb b/lib/zitadel/client/models/identity_provider_service_apple_config.rb deleted file mode 100644 index 77e5129a..00000000 --- a/lib/zitadel/client/models/identity_provider_service_apple_config.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceAppleConfig - # Client id (App ID or Service ID) provided by Apple. - attr_accessor :client_id - - # Team ID provided by Apple. - attr_accessor :team_id - - # ID of the private key generated by Apple. - attr_accessor :key_id - - # The scopes requested by ZITADEL during the request to Apple. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'team_id' => :'teamId', - :'key_id' => :'keyId', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'team_id' => :'String', - :'key_id' => :'String', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceAppleConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceAppleConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'team_id') - self.team_id = attributes[:'team_id'] - end - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - team_id == o.team_id && - key_id == o.key_id && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, team_id, key_id, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_azure_a_d_config.rb b/lib/zitadel/client/models/identity_provider_service_azure_a_d_config.rb deleted file mode 100644 index ccd84e41..00000000 --- a/lib/zitadel/client/models/identity_provider_service_azure_a_d_config.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceAzureADConfig - attr_accessor :client_id - - attr_accessor :tenant - - # Azure AD doesn't send if the email has been verified. Enable this if the user email should always be added verified in ZITADEL (no verification emails will be sent). - attr_accessor :email_verified - - # The scopes requested by ZITADEL during the request to Azure AD. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'tenant' => :'tenant', - :'email_verified' => :'emailVerified', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'tenant' => :'IdentityProviderServiceAzureADTenant', - :'email_verified' => :'Boolean', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceAzureADConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceAzureADConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'tenant') - self.tenant = attributes[:'tenant'] - end - - if attributes.key?(:'email_verified') - self.email_verified = attributes[:'email_verified'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - tenant == o.tenant && - email_verified == o.email_verified && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, tenant, email_verified, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_connect_error.rb b/lib/zitadel/client/models/identity_provider_service_connect_error.rb new file mode 100644 index 00000000..1fbf781a --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class IdentityProviderServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'IdentityProviderServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_details.rb b/lib/zitadel/client/models/identity_provider_service_details.rb index e2d4b9b5..f1198f16 100644 --- a/lib/zitadel/client/models/identity_provider_service_details.rb +++ b/lib/zitadel/client/models/identity_provider_service_details.rb @@ -15,14 +15,16 @@ module Zitadel::Client::Models class IdentityProviderServiceDetails - # on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation attr_accessor :sequence - # on read: the timestamp of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date + # resource_owner is the organization or instance_id an object belongs to attr_accessor :resource_owner + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date # Attribute mapping from ruby-style variable name to JSON key. @@ -48,7 +50,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'sequence' => :'String', + :'sequence' => :'Object', :'change_date' => :'Time', :'resource_owner' => :'String', :'creation_date' => :'Time' @@ -58,6 +60,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/identity_provider_service_generic_o_i_d_c_config.rb b/lib/zitadel/client/models/identity_provider_service_generic_o_i_d_c_config.rb deleted file mode 100644 index 3ed0afaa..00000000 --- a/lib/zitadel/client/models/identity_provider_service_generic_o_i_d_c_config.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGenericOIDCConfig - # The OIDC issuer of the identity provider. - attr_accessor :issuer - - # Client id generated by the identity provider. - attr_accessor :client_id - - # The scopes requested by ZITADEL during the request on the identity provider. - attr_accessor :scopes - - # If true, provider information get mapped from the id token, not from the userinfo endpoint. - attr_accessor :is_id_token_mapping - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'issuer' => :'issuer', - :'client_id' => :'clientId', - :'scopes' => :'scopes', - :'is_id_token_mapping' => :'isIdTokenMapping' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'issuer' => :'String', - :'client_id' => :'String', - :'scopes' => :'Array', - :'is_id_token_mapping' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGenericOIDCConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGenericOIDCConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'issuer') - self.issuer = attributes[:'issuer'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - - if attributes.key?(:'is_id_token_mapping') - self.is_id_token_mapping = attributes[:'is_id_token_mapping'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - issuer == o.issuer && - client_id == o.client_id && - scopes == o.scopes && - is_id_token_mapping == o.is_id_token_mapping - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [issuer, client_id, scopes, is_id_token_mapping].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_protobuf_any.rb b/lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_request.rb similarity index 92% rename from lib/zitadel/client/models/o_i_d_c_service_protobuf_any.rb rename to lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_request.rb index 6ae4aa78..fa182f2c 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_protobuf_any.rb +++ b/lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_request.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class OIDCServiceProtobufAny - attr_accessor :type + class IdentityProviderServiceGetIDPByIDRequest + attr_accessor :id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'id' => :'id' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'id' => :'String' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGetIDPByIDRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGetIDPByIDRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'id') + self.id = attributes[:'id'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + id == o.id end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rb b/lib/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rb deleted file mode 100644 index c8f924fb..00000000 --- a/lib/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGitHubEnterpriseServerConfig - # The client ID of the GitHub App. - attr_accessor :client_id - - attr_accessor :authorization_endpoint - - attr_accessor :token_endpoint - - attr_accessor :user_endpoint - - # The scopes requested by ZITADEL during the request to GitHub. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'authorization_endpoint' => :'authorizationEndpoint', - :'token_endpoint' => :'tokenEndpoint', - :'user_endpoint' => :'userEndpoint', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'authorization_endpoint' => :'String', - :'token_endpoint' => :'String', - :'user_endpoint' => :'String', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGitHubEnterpriseServerConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGitHubEnterpriseServerConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'authorization_endpoint') - self.authorization_endpoint = attributes[:'authorization_endpoint'] - end - - if attributes.key?(:'token_endpoint') - self.token_endpoint = attributes[:'token_endpoint'] - end - - if attributes.key?(:'user_endpoint') - self.user_endpoint = attributes[:'user_endpoint'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - authorization_endpoint == o.authorization_endpoint && - token_endpoint == o.token_endpoint && - user_endpoint == o.user_endpoint && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, authorization_endpoint, token_endpoint, user_endpoint, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_i_d_p.rb b/lib/zitadel/client/models/identity_provider_service_i_d_p.rb index 579f8eee..3bb95de2 100644 --- a/lib/zitadel/client/models/identity_provider_service_i_d_p.rb +++ b/lib/zitadel/client/models/identity_provider_service_i_d_p.rb @@ -118,8 +118,6 @@ def initialize(attributes = {}) if attributes.key?(:'state') self.state = attributes[:'state'] - else - self.state = 'IDP_STATE_UNSPECIFIED' end if attributes.key?(:'name') @@ -128,8 +126,6 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] - else - self.type = 'IDP_TYPE_UNSPECIFIED' end if attributes.key?(:'config') diff --git a/lib/zitadel/client/models/identity_provider_service_i_d_p_config.rb b/lib/zitadel/client/models/identity_provider_service_i_d_p_config.rb deleted file mode 100644 index e8556de7..00000000 --- a/lib/zitadel/client/models/identity_provider_service_i_d_p_config.rb +++ /dev/null @@ -1,338 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceIDPConfig - attr_accessor :options - - attr_accessor :ldap - - attr_accessor :google - - attr_accessor :oauth - - attr_accessor :oidc - - attr_accessor :jwt - - attr_accessor :github - - attr_accessor :github_es - - attr_accessor :gitlab - - attr_accessor :gitlab_self_hosted - - attr_accessor :azure_ad - - attr_accessor :apple - - attr_accessor :saml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'options' => :'options', - :'ldap' => :'ldap', - :'google' => :'google', - :'oauth' => :'oauth', - :'oidc' => :'oidc', - :'jwt' => :'jwt', - :'github' => :'github', - :'github_es' => :'githubEs', - :'gitlab' => :'gitlab', - :'gitlab_self_hosted' => :'gitlabSelfHosted', - :'azure_ad' => :'azureAd', - :'apple' => :'apple', - :'saml' => :'saml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'options' => :'IdentityProviderServiceOptions', - :'ldap' => :'IdentityProviderServiceLDAPConfig', - :'google' => :'IdentityProviderServiceGoogleConfig', - :'oauth' => :'IdentityProviderServiceOAuthConfig', - :'oidc' => :'IdentityProviderServiceGenericOIDCConfig', - :'jwt' => :'IdentityProviderServiceJWTConfig', - :'github' => :'IdentityProviderServiceGitHubConfig', - :'github_es' => :'IdentityProviderServiceGitHubEnterpriseServerConfig', - :'gitlab' => :'IdentityProviderServiceGitLabConfig', - :'gitlab_self_hosted' => :'IdentityProviderServiceGitLabSelfHostedConfig', - :'azure_ad' => :'IdentityProviderServiceAzureADConfig', - :'apple' => :'IdentityProviderServiceAppleConfig', - :'saml' => :'IdentityProviderServiceSAMLConfig' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceIDPConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceIDPConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - - if attributes.key?(:'ldap') - self.ldap = attributes[:'ldap'] - end - - if attributes.key?(:'google') - self.google = attributes[:'google'] - end - - if attributes.key?(:'oauth') - self.oauth = attributes[:'oauth'] - end - - if attributes.key?(:'oidc') - self.oidc = attributes[:'oidc'] - end - - if attributes.key?(:'jwt') - self.jwt = attributes[:'jwt'] - end - - if attributes.key?(:'github') - self.github = attributes[:'github'] - end - - if attributes.key?(:'github_es') - self.github_es = attributes[:'github_es'] - end - - if attributes.key?(:'gitlab') - self.gitlab = attributes[:'gitlab'] - end - - if attributes.key?(:'gitlab_self_hosted') - self.gitlab_self_hosted = attributes[:'gitlab_self_hosted'] - end - - if attributes.key?(:'azure_ad') - self.azure_ad = attributes[:'azure_ad'] - end - - if attributes.key?(:'apple') - self.apple = attributes[:'apple'] - end - - if attributes.key?(:'saml') - self.saml = attributes[:'saml'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - options == o.options && - ldap == o.ldap && - google == o.google && - oauth == o.oauth && - oidc == o.oidc && - jwt == o.jwt && - github == o.github && - github_es == o.github_es && - gitlab == o.gitlab && - gitlab_self_hosted == o.gitlab_self_hosted && - azure_ad == o.azure_ad && - apple == o.apple && - saml == o.saml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [options, ldap, google, oauth, oidc, jwt, github, github_es, gitlab, gitlab_self_hosted, azure_ad, apple, saml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_idp_config.rb b/lib/zitadel/client/models/identity_provider_service_idp_config.rb new file mode 100644 index 00000000..7ad4af43 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_idp_config.rb @@ -0,0 +1,120 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module IdentityProviderServiceIDPConfig + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Apple', + :'AzureAd', + :'Github', + :'GithubEs', + :'Gitlab', + :'GitlabSelfHosted', + :'Google', + :'Jwt', + :'Ldap', + :'Oauth', + :'Oidc', + :'Saml' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/identity_provider_service_l_d_a_p_attributes.rb b/lib/zitadel/client/models/identity_provider_service_l_d_a_p_attributes.rb deleted file mode 100644 index d5f8c406..00000000 --- a/lib/zitadel/client/models/identity_provider_service_l_d_a_p_attributes.rb +++ /dev/null @@ -1,347 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceLDAPAttributes - attr_accessor :id_attribute - - attr_accessor :first_name_attribute - - attr_accessor :last_name_attribute - - attr_accessor :display_name_attribute - - attr_accessor :nick_name_attribute - - attr_accessor :preferred_username_attribute - - attr_accessor :email_attribute - - attr_accessor :email_verified_attribute - - attr_accessor :phone_attribute - - attr_accessor :phone_verified_attribute - - attr_accessor :preferred_language_attribute - - attr_accessor :avatar_url_attribute - - attr_accessor :profile_attribute - - attr_accessor :root_ca - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id_attribute' => :'idAttribute', - :'first_name_attribute' => :'firstNameAttribute', - :'last_name_attribute' => :'lastNameAttribute', - :'display_name_attribute' => :'displayNameAttribute', - :'nick_name_attribute' => :'nickNameAttribute', - :'preferred_username_attribute' => :'preferredUsernameAttribute', - :'email_attribute' => :'emailAttribute', - :'email_verified_attribute' => :'emailVerifiedAttribute', - :'phone_attribute' => :'phoneAttribute', - :'phone_verified_attribute' => :'phoneVerifiedAttribute', - :'preferred_language_attribute' => :'preferredLanguageAttribute', - :'avatar_url_attribute' => :'avatarUrlAttribute', - :'profile_attribute' => :'profileAttribute', - :'root_ca' => :'rootCa' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id_attribute' => :'String', - :'first_name_attribute' => :'String', - :'last_name_attribute' => :'String', - :'display_name_attribute' => :'String', - :'nick_name_attribute' => :'String', - :'preferred_username_attribute' => :'String', - :'email_attribute' => :'String', - :'email_verified_attribute' => :'String', - :'phone_attribute' => :'String', - :'phone_verified_attribute' => :'String', - :'preferred_language_attribute' => :'String', - :'avatar_url_attribute' => :'String', - :'profile_attribute' => :'String', - :'root_ca' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceLDAPAttributes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceLDAPAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id_attribute') - self.id_attribute = attributes[:'id_attribute'] - end - - if attributes.key?(:'first_name_attribute') - self.first_name_attribute = attributes[:'first_name_attribute'] - end - - if attributes.key?(:'last_name_attribute') - self.last_name_attribute = attributes[:'last_name_attribute'] - end - - if attributes.key?(:'display_name_attribute') - self.display_name_attribute = attributes[:'display_name_attribute'] - end - - if attributes.key?(:'nick_name_attribute') - self.nick_name_attribute = attributes[:'nick_name_attribute'] - end - - if attributes.key?(:'preferred_username_attribute') - self.preferred_username_attribute = attributes[:'preferred_username_attribute'] - end - - if attributes.key?(:'email_attribute') - self.email_attribute = attributes[:'email_attribute'] - end - - if attributes.key?(:'email_verified_attribute') - self.email_verified_attribute = attributes[:'email_verified_attribute'] - end - - if attributes.key?(:'phone_attribute') - self.phone_attribute = attributes[:'phone_attribute'] - end - - if attributes.key?(:'phone_verified_attribute') - self.phone_verified_attribute = attributes[:'phone_verified_attribute'] - end - - if attributes.key?(:'preferred_language_attribute') - self.preferred_language_attribute = attributes[:'preferred_language_attribute'] - end - - if attributes.key?(:'avatar_url_attribute') - self.avatar_url_attribute = attributes[:'avatar_url_attribute'] - end - - if attributes.key?(:'profile_attribute') - self.profile_attribute = attributes[:'profile_attribute'] - end - - if attributes.key?(:'root_ca') - self.root_ca = attributes[:'root_ca'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id_attribute == o.id_attribute && - first_name_attribute == o.first_name_attribute && - last_name_attribute == o.last_name_attribute && - display_name_attribute == o.display_name_attribute && - nick_name_attribute == o.nick_name_attribute && - preferred_username_attribute == o.preferred_username_attribute && - email_attribute == o.email_attribute && - email_verified_attribute == o.email_verified_attribute && - phone_attribute == o.phone_attribute && - phone_verified_attribute == o.phone_verified_attribute && - preferred_language_attribute == o.preferred_language_attribute && - avatar_url_attribute == o.avatar_url_attribute && - profile_attribute == o.profile_attribute && - root_ca == o.root_ca - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id_attribute, first_name_attribute, last_name_attribute, display_name_attribute, nick_name_attribute, preferred_username_attribute, email_attribute, email_verified_attribute, phone_attribute, phone_verified_attribute, preferred_language_attribute, avatar_url_attribute, profile_attribute, root_ca].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_l_d_a_p_config.rb b/lib/zitadel/client/models/identity_provider_service_l_d_a_p_config.rb deleted file mode 100644 index cdcbe55f..00000000 --- a/lib/zitadel/client/models/identity_provider_service_l_d_a_p_config.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceLDAPConfig - attr_accessor :servers - - attr_accessor :start_tls - - attr_accessor :base_dn - - attr_accessor :bind_dn - - attr_accessor :user_base - - attr_accessor :user_object_classes - - attr_accessor :user_filters - - attr_accessor :timeout - - attr_accessor :attributes - - attr_accessor :root_ca - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'servers' => :'servers', - :'start_tls' => :'startTls', - :'base_dn' => :'baseDn', - :'bind_dn' => :'bindDn', - :'user_base' => :'userBase', - :'user_object_classes' => :'userObjectClasses', - :'user_filters' => :'userFilters', - :'timeout' => :'timeout', - :'attributes' => :'attributes', - :'root_ca' => :'rootCa' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'servers' => :'Array', - :'start_tls' => :'Boolean', - :'base_dn' => :'String', - :'bind_dn' => :'String', - :'user_base' => :'String', - :'user_object_classes' => :'Array', - :'user_filters' => :'Array', - :'timeout' => :'String', - :'attributes' => :'IdentityProviderServiceLDAPAttributes', - :'root_ca' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceLDAPConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceLDAPConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'servers') - if (value = attributes[:'servers']).is_a?(Array) - self.servers = value - end - end - - if attributes.key?(:'start_tls') - self.start_tls = attributes[:'start_tls'] - end - - if attributes.key?(:'base_dn') - self.base_dn = attributes[:'base_dn'] - end - - if attributes.key?(:'bind_dn') - self.bind_dn = attributes[:'bind_dn'] - end - - if attributes.key?(:'user_base') - self.user_base = attributes[:'user_base'] - end - - if attributes.key?(:'user_object_classes') - if (value = attributes[:'user_object_classes']).is_a?(Array) - self.user_object_classes = value - end - end - - if attributes.key?(:'user_filters') - if (value = attributes[:'user_filters']).is_a?(Array) - self.user_filters = value - end - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'root_ca') - self.root_ca = attributes[:'root_ca'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - servers == o.servers && - start_tls == o.start_tls && - base_dn == o.base_dn && - bind_dn == o.bind_dn && - user_base == o.user_base && - user_object_classes == o.user_object_classes && - user_filters == o.user_filters && - timeout == o.timeout && - attributes == o.attributes && - root_ca == o.root_ca - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [servers, start_tls, base_dn, bind_dn, user_base, user_object_classes, user_filters, timeout, attributes, root_ca].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_options.rb b/lib/zitadel/client/models/identity_provider_service_options.rb index 43a19043..4014783f 100644 --- a/lib/zitadel/client/models/identity_provider_service_options.rb +++ b/lib/zitadel/client/models/identity_provider_service_options.rb @@ -15,16 +15,16 @@ module Zitadel::Client::Models class IdentityProviderServiceOptions - # Enable if users should be able to link an existing ZITADEL user with an external account. + # Enable if users should be able to link an existing ZITADEL user with an external account. attr_accessor :is_linking_allowed - # Enable if users should be able to create a new account in ZITADEL when using an external account. + # Enable if users should be able to create a new account in ZITADEL when using an external account. attr_accessor :is_creation_allowed - # Enable if a new account in ZITADEL should be created automatically when login with an external account. + # Enable if a new account in ZITADEL should be created automatically when login with an external account. attr_accessor :is_auto_creation - # Enable if a the ZITADEL account fields should be updated automatically on each login. + # Enable if a the ZITADEL account fields should be updated automatically on each login. attr_accessor :is_auto_update attr_accessor :auto_linking @@ -125,8 +125,6 @@ def initialize(attributes = {}) if attributes.key?(:'auto_linking') self.auto_linking = attributes[:'auto_linking'] - else - self.auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_config.rb b/lib/zitadel/client/models/identity_provider_service_s_a_m_l_config.rb deleted file mode 100644 index f5fe83ac..00000000 --- a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_config.rb +++ /dev/null @@ -1,305 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceSAMLConfig - # Metadata of the SAML identity provider. - attr_accessor :metadata_xml - - attr_accessor :binding - - # Boolean which defines if the authentication requests are signed. - attr_accessor :with_signed_request - - attr_accessor :name_id_format - - # Optional name of the attribute, which will be used to map the user in case the nameid-format returned is `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`. - attr_accessor :transient_mapping_attribute_name - - # Boolean weather federated logout is enabled. If enabled, ZITADEL will send a logout request to the identity provider, if the user terminates the session in ZITADEL. Be sure to provide a SLO endpoint as part of the metadata. - attr_accessor :federated_logout_enabled - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'metadata_xml' => :'metadataXml', - :'binding' => :'binding', - :'with_signed_request' => :'withSignedRequest', - :'name_id_format' => :'nameIdFormat', - :'transient_mapping_attribute_name' => :'transientMappingAttributeName', - :'federated_logout_enabled' => :'federatedLogoutEnabled' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'metadata_xml' => :'String', - :'binding' => :'IdentityProviderServiceSAMLBinding', - :'with_signed_request' => :'Boolean', - :'name_id_format' => :'IdentityProviderServiceSAMLNameIDFormat', - :'transient_mapping_attribute_name' => :'String', - :'federated_logout_enabled' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceSAMLConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceSAMLConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'metadata_xml') - self.metadata_xml = attributes[:'metadata_xml'] - end - - if attributes.key?(:'binding') - self.binding = attributes[:'binding'] - else - self.binding = 'SAML_BINDING_UNSPECIFIED' - end - - if attributes.key?(:'with_signed_request') - self.with_signed_request = attributes[:'with_signed_request'] - end - - if attributes.key?(:'name_id_format') - self.name_id_format = attributes[:'name_id_format'] - else - self.name_id_format = 'SAML_NAME_ID_FORMAT_UNSPECIFIED' - end - - if attributes.key?(:'transient_mapping_attribute_name') - self.transient_mapping_attribute_name = attributes[:'transient_mapping_attribute_name'] - end - - if attributes.key?(:'federated_logout_enabled') - self.federated_logout_enabled = attributes[:'federated_logout_enabled'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - metadata_xml == o.metadata_xml && - binding == o.binding && - with_signed_request == o.with_signed_request && - name_id_format == o.name_id_format && - transient_mapping_attribute_name == o.transient_mapping_attribute_name && - federated_logout_enabled == o.federated_logout_enabled - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [metadata_xml, binding, with_signed_request, name_id_format, transient_mapping_attribute_name, federated_logout_enabled].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/idp_intent.rb b/lib/zitadel/client/models/idp_intent.rb new file mode 100644 index 00000000..a5e7ed11 --- /dev/null +++ b/lib/zitadel/client/models/idp_intent.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class IdpIntent + attr_accessor :idp_intent + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'idp_intent' => :'idpIntent' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'idp_intent' => :'UserServiceIDPIntent' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdpIntent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdpIntent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'idp_intent') + self.idp_intent = attributes[:'idp_intent'] + else + self.idp_intent = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @idp_intent.nil? + invalid_properties.push('invalid value for "idp_intent", idp_intent cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @idp_intent.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceIDPIntent] idp_intent Value to be assigned + def idp_intent=(idp_intent) + if idp_intent.nil? + fail ArgumentError, 'idp_intent cannot be nil' + end + + @idp_intent = idp_intent + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + idp_intent == o.idp_intent + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [idp_intent].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/idp_intent1.rb b/lib/zitadel/client/models/idp_intent1.rb new file mode 100644 index 00000000..6db06873 --- /dev/null +++ b/lib/zitadel/client/models/idp_intent1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class IdpIntent1 + attr_accessor :idp_intent + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'idp_intent' => :'idpIntent' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'idp_intent' => :'BetaUserServiceIDPIntent' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdpIntent1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdpIntent1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'idp_intent') + self.idp_intent = attributes[:'idp_intent'] + else + self.idp_intent = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @idp_intent.nil? + invalid_properties.push('invalid value for "idp_intent", idp_intent cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @idp_intent.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceIDPIntent] idp_intent Value to be assigned + def idp_intent=(idp_intent) + if idp_intent.nil? + fail ArgumentError, 'idp_intent cannot be nil' + end + + @idp_intent = idp_intent + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + idp_intent == o.idp_intent + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [idp_intent].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/ids_query.rb b/lib/zitadel/client/models/ids_query.rb new file mode 100644 index 00000000..a48d03bc --- /dev/null +++ b/lib/zitadel/client/models/ids_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class IdsQuery + attr_accessor :ids_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ids_query' => :'idsQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ids_query' => :'BetaSessionServiceIDsQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdsQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ids_query') + self.ids_query = attributes[:'ids_query'] + else + self.ids_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ids_query.nil? + invalid_properties.push('invalid value for "ids_query", ids_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ids_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaSessionServiceIDsQuery] ids_query Value to be assigned + def ids_query=(ids_query) + if ids_query.nil? + fail ArgumentError, 'ids_query cannot be nil' + end + + @ids_query = ids_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ids_query == o.ids_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ids_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/ids_query1.rb b/lib/zitadel/client/models/ids_query1.rb new file mode 100644 index 00000000..b60c9afd --- /dev/null +++ b/lib/zitadel/client/models/ids_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class IdsQuery1 + attr_accessor :ids_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ids_query' => :'idsQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ids_query' => :'SessionServiceIDsQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdsQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdsQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ids_query') + self.ids_query = attributes[:'ids_query'] + else + self.ids_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ids_query.nil? + invalid_properties.push('invalid value for "ids_query", ids_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ids_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [SessionServiceIDsQuery] ids_query Value to be assigned + def ids_query=(ids_query) + if ids_query.nil? + fail ArgumentError, 'ids_query cannot be nil' + end + + @ids_query = ids_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ids_query == o.ids_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ids_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/in_conditions_filter.rb b/lib/zitadel/client/models/in_conditions_filter.rb new file mode 100644 index 00000000..1a52f2a6 --- /dev/null +++ b/lib/zitadel/client/models/in_conditions_filter.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class InConditionsFilter + attr_accessor :in_conditions_filter + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'in_conditions_filter' => :'inConditionsFilter' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'in_conditions_filter' => :'BetaActionServiceInConditionsFilter' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InConditionsFilter` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InConditionsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'in_conditions_filter') + self.in_conditions_filter = attributes[:'in_conditions_filter'] + else + self.in_conditions_filter = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @in_conditions_filter.nil? + invalid_properties.push('invalid value for "in_conditions_filter", in_conditions_filter cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @in_conditions_filter.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceInConditionsFilter] in_conditions_filter Value to be assigned + def in_conditions_filter=(in_conditions_filter) + if in_conditions_filter.nil? + fail ArgumentError, 'in_conditions_filter cannot be nil' + end + + @in_conditions_filter = in_conditions_filter + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + in_conditions_filter == o.in_conditions_filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [in_conditions_filter].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_target_search_filter.rb b/lib/zitadel/client/models/in_target_ids_filter.rb similarity index 87% rename from lib/zitadel/client/models/action_service_beta_target_search_filter.rb rename to lib/zitadel/client/models/in_target_ids_filter.rb index 5c7a9841..0b7fc6ab 100644 --- a/lib/zitadel/client/models/action_service_beta_target_search_filter.rb +++ b/lib/zitadel/client/models/in_target_ids_filter.rb @@ -14,15 +14,12 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaTargetSearchFilter - attr_accessor :target_name_filter - + class InTargetIdsFilter attr_accessor :in_target_ids_filter # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'target_name_filter' => :'targetNameFilter', :'in_target_ids_filter' => :'inTargetIdsFilter' } end @@ -40,8 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'target_name_filter' => :'ActionServiceBetaTargetNameFilter', - :'in_target_ids_filter' => :'ActionServiceBetaInTargetIDsFilter' + :'in_target_ids_filter' => :'BetaActionServiceInTargetIDsFilter' } end @@ -56,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaTargetSearchFilter` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InTargetIdsFilter` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaTargetSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InTargetIdsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'target_name_filter') - self.target_name_filter = attributes[:'target_name_filter'] - end - if attributes.key?(:'in_target_ids_filter') self.in_target_ids_filter = attributes[:'in_target_ids_filter'] + else + self.in_target_ids_filter = nil end end @@ -83,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @in_target_ids_filter.nil? + invalid_properties.push('invalid value for "in_target_ids_filter", in_target_ids_filter cannot be nil.') + end + invalid_properties end @@ -90,15 +88,25 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @in_target_ids_filter.nil? true end + # Custom attribute writer method with validation + # @param [BetaActionServiceInTargetIDsFilter] in_target_ids_filter Value to be assigned + def in_target_ids_filter=(in_target_ids_filter) + if in_target_ids_filter.nil? + fail ArgumentError, 'in_target_ids_filter cannot be nil' + end + + @in_target_ids_filter = in_target_ids_filter + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - target_name_filter == o.target_name_filter && in_target_ids_filter == o.in_target_ids_filter end @@ -111,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [target_name_filter, in_target_ids_filter].hash + [in_target_ids_filter].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/in_user_emails_query.rb b/lib/zitadel/client/models/in_user_emails_query.rb new file mode 100644 index 00000000..93c483ca --- /dev/null +++ b/lib/zitadel/client/models/in_user_emails_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class InUserEmailsQuery + attr_accessor :in_user_emails_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'in_user_emails_query' => :'inUserEmailsQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'in_user_emails_query' => :'UserServiceInUserEmailsQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InUserEmailsQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InUserEmailsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'in_user_emails_query') + self.in_user_emails_query = attributes[:'in_user_emails_query'] + else + self.in_user_emails_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @in_user_emails_query.nil? + invalid_properties.push('invalid value for "in_user_emails_query", in_user_emails_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @in_user_emails_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceInUserEmailsQuery] in_user_emails_query Value to be assigned + def in_user_emails_query=(in_user_emails_query) + if in_user_emails_query.nil? + fail ArgumentError, 'in_user_emails_query cannot be nil' + end + + @in_user_emails_query = in_user_emails_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + in_user_emails_query == o.in_user_emails_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [in_user_emails_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/in_user_emails_query1.rb b/lib/zitadel/client/models/in_user_emails_query1.rb new file mode 100644 index 00000000..3ca6b3d0 --- /dev/null +++ b/lib/zitadel/client/models/in_user_emails_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class InUserEmailsQuery1 + attr_accessor :in_user_emails_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'in_user_emails_query' => :'inUserEmailsQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'in_user_emails_query' => :'BetaUserServiceInUserEmailsQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InUserEmailsQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InUserEmailsQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'in_user_emails_query') + self.in_user_emails_query = attributes[:'in_user_emails_query'] + else + self.in_user_emails_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @in_user_emails_query.nil? + invalid_properties.push('invalid value for "in_user_emails_query", in_user_emails_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @in_user_emails_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceInUserEmailsQuery] in_user_emails_query Value to be assigned + def in_user_emails_query=(in_user_emails_query) + if in_user_emails_query.nil? + fail ArgumentError, 'in_user_emails_query cannot be nil' + end + + @in_user_emails_query = in_user_emails_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + in_user_emails_query == o.in_user_emails_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [in_user_emails_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/in_user_ids_query.rb b/lib/zitadel/client/models/in_user_ids_query.rb new file mode 100644 index 00000000..6808a9e4 --- /dev/null +++ b/lib/zitadel/client/models/in_user_ids_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class InUserIdsQuery + attr_accessor :in_user_ids_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'in_user_ids_query' => :'inUserIdsQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'in_user_ids_query' => :'UserServiceInUserIDQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InUserIdsQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InUserIdsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'in_user_ids_query') + self.in_user_ids_query = attributes[:'in_user_ids_query'] + else + self.in_user_ids_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @in_user_ids_query.nil? + invalid_properties.push('invalid value for "in_user_ids_query", in_user_ids_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @in_user_ids_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceInUserIDQuery] in_user_ids_query Value to be assigned + def in_user_ids_query=(in_user_ids_query) + if in_user_ids_query.nil? + fail ArgumentError, 'in_user_ids_query cannot be nil' + end + + @in_user_ids_query = in_user_ids_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + in_user_ids_query == o.in_user_ids_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [in_user_ids_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/in_user_ids_query1.rb b/lib/zitadel/client/models/in_user_ids_query1.rb new file mode 100644 index 00000000..f9cc1461 --- /dev/null +++ b/lib/zitadel/client/models/in_user_ids_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class InUserIdsQuery1 + attr_accessor :in_user_ids_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'in_user_ids_query' => :'inUserIdsQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'in_user_ids_query' => :'BetaUserServiceInUserIDQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InUserIdsQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InUserIdsQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'in_user_ids_query') + self.in_user_ids_query = attributes[:'in_user_ids_query'] + else + self.in_user_ids_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @in_user_ids_query.nil? + invalid_properties.push('invalid value for "in_user_ids_query", in_user_ids_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @in_user_ids_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceInUserIDQuery] in_user_ids_query Value to be assigned + def in_user_ids_query=(in_user_ids_query) + if in_user_ids_query.nil? + fail ArgumentError, 'in_user_ids_query cannot be nil' + end + + @in_user_ids_query = in_user_ids_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + in_user_ids_query == o.in_user_ids_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [in_user_ids_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/instance.rb b/lib/zitadel/client/models/instance.rb new file mode 100644 index 00000000..1e89c1cd --- /dev/null +++ b/lib/zitadel/client/models/instance.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Instance + attr_accessor :instance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'instance' => :'instance' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'instance' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Instance` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Instance`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'instance') + self.instance = attributes[:'instance'] + else + self.instance = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @instance.nil? + invalid_properties.push('invalid value for "instance", instance cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @instance.nil? + true + end + + # Custom attribute writer method with validation + # @param [Boolean] instance Value to be assigned + def instance=(instance) + if instance.nil? + fail ArgumentError, 'instance cannot be nil' + end + + @instance = instance + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + instance == o.instance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [instance].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/is_verified.rb b/lib/zitadel/client/models/is_verified.rb new file mode 100644 index 00000000..d81ab98b --- /dev/null +++ b/lib/zitadel/client/models/is_verified.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class IsVerified + attr_accessor :is_verified + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'is_verified' => :'isVerified' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'is_verified' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IsVerified` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IsVerified`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'is_verified') + self.is_verified = attributes[:'is_verified'] + else + self.is_verified = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @is_verified.nil? + invalid_properties.push('invalid value for "is_verified", is_verified cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @is_verified.nil? + true + end + + # Custom attribute writer method with validation + # @param [Boolean] is_verified Value to be assigned + def is_verified=(is_verified) + if is_verified.nil? + fail ArgumentError, 'is_verified cannot be nil' + end + + @is_verified = is_verified + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + is_verified == o.is_verified + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [is_verified].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/jwt.rb b/lib/zitadel/client/models/jwt.rb new file mode 100644 index 00000000..f745ad33 --- /dev/null +++ b/lib/zitadel/client/models/jwt.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Jwt + attr_accessor :jwt + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'jwt' => :'jwt' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'jwt' => :'IdentityProviderServiceJWTConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Jwt` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Jwt`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'jwt') + self.jwt = attributes[:'jwt'] + else + self.jwt = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @jwt.nil? + invalid_properties.push('invalid value for "jwt", jwt cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @jwt.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceJWTConfig] jwt Value to be assigned + def jwt=(jwt) + if jwt.nil? + fail ArgumentError, 'jwt cannot be nil' + end + + @jwt = jwt + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + jwt == o.jwt + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [jwt].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/last_name_query.rb b/lib/zitadel/client/models/last_name_query.rb new file mode 100644 index 00000000..fa556908 --- /dev/null +++ b/lib/zitadel/client/models/last_name_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class LastNameQuery + attr_accessor :last_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'last_name_query' => :'lastNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'last_name_query' => :'UserServiceLastNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::LastNameQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::LastNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'last_name_query') + self.last_name_query = attributes[:'last_name_query'] + else + self.last_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @last_name_query.nil? + invalid_properties.push('invalid value for "last_name_query", last_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @last_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceLastNameQuery] last_name_query Value to be assigned + def last_name_query=(last_name_query) + if last_name_query.nil? + fail ArgumentError, 'last_name_query cannot be nil' + end + + @last_name_query = last_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + last_name_query == o.last_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [last_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/last_name_query1.rb b/lib/zitadel/client/models/last_name_query1.rb new file mode 100644 index 00000000..491f58c2 --- /dev/null +++ b/lib/zitadel/client/models/last_name_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class LastNameQuery1 + attr_accessor :last_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'last_name_query' => :'lastNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'last_name_query' => :'BetaUserServiceLastNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::LastNameQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::LastNameQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'last_name_query') + self.last_name_query = attributes[:'last_name_query'] + else + self.last_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @last_name_query.nil? + invalid_properties.push('invalid value for "last_name_query", last_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @last_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceLastNameQuery] last_name_query Value to be assigned + def last_name_query=(last_name_query) + if last_name_query.nil? + fail ArgumentError, 'last_name_query cannot be nil' + end + + @last_name_query = last_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + last_name_query == o.last_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [last_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/ldap.rb b/lib/zitadel/client/models/ldap.rb new file mode 100644 index 00000000..a94e8cf0 --- /dev/null +++ b/lib/zitadel/client/models/ldap.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Ldap + attr_accessor :ldap + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ldap' => :'ldap' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ldap' => :'IdentityProviderServiceLDAPConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Ldap` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Ldap`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ldap') + self.ldap = attributes[:'ldap'] + else + self.ldap = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ldap.nil? + invalid_properties.push('invalid value for "ldap", ldap cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ldap.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceLDAPConfig] ldap Value to be assigned + def ldap=(ldap) + if ldap.nil? + fail ArgumentError, 'ldap cannot be nil' + end + + @ldap = ldap + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ldap == o.ldap + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ldap].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/ldap1.rb b/lib/zitadel/client/models/ldap1.rb new file mode 100644 index 00000000..743b259b --- /dev/null +++ b/lib/zitadel/client/models/ldap1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Ldap1 + attr_accessor :ldap + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ldap' => :'ldap' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ldap' => :'UserServiceLDAPCredentials' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Ldap1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Ldap1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ldap') + self.ldap = attributes[:'ldap'] + else + self.ldap = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ldap.nil? + invalid_properties.push('invalid value for "ldap", ldap cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ldap.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceLDAPCredentials] ldap Value to be assigned + def ldap=(ldap) + if ldap.nil? + fail ArgumentError, 'ldap cannot be nil' + end + + @ldap = ldap + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ldap == o.ldap + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ldap].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/ldap2.rb b/lib/zitadel/client/models/ldap2.rb new file mode 100644 index 00000000..e5931fd6 --- /dev/null +++ b/lib/zitadel/client/models/ldap2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Ldap2 + attr_accessor :ldap + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ldap' => :'ldap' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ldap' => :'UserServiceIDPLDAPAccessInformation' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Ldap2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Ldap2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ldap') + self.ldap = attributes[:'ldap'] + else + self.ldap = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ldap.nil? + invalid_properties.push('invalid value for "ldap", ldap cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ldap.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceIDPLDAPAccessInformation] ldap Value to be assigned + def ldap=(ldap) + if ldap.nil? + fail ArgumentError, 'ldap cannot be nil' + end + + @ldap = ldap + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ldap == o.ldap + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ldap].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/ldap3.rb b/lib/zitadel/client/models/ldap3.rb new file mode 100644 index 00000000..b8ca468d --- /dev/null +++ b/lib/zitadel/client/models/ldap3.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Ldap3 + attr_accessor :ldap + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ldap' => :'ldap' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ldap' => :'BetaUserServiceLDAPCredentials' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Ldap3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Ldap3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ldap') + self.ldap = attributes[:'ldap'] + else + self.ldap = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ldap.nil? + invalid_properties.push('invalid value for "ldap", ldap cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ldap.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceLDAPCredentials] ldap Value to be assigned + def ldap=(ldap) + if ldap.nil? + fail ArgumentError, 'ldap cannot be nil' + end + + @ldap = ldap + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ldap == o.ldap + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ldap].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/ldap4.rb b/lib/zitadel/client/models/ldap4.rb new file mode 100644 index 00000000..706bffd0 --- /dev/null +++ b/lib/zitadel/client/models/ldap4.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Ldap4 + attr_accessor :ldap + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ldap' => :'ldap' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ldap' => :'BetaUserServiceIDPLDAPAccessInformation' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Ldap4` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Ldap4`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ldap') + self.ldap = attributes[:'ldap'] + else + self.ldap = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @ldap.nil? + invalid_properties.push('invalid value for "ldap", ldap cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @ldap.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceIDPLDAPAccessInformation] ldap Value to be assigned + def ldap=(ldap) + if ldap.nil? + fail ArgumentError, 'ldap cannot be nil' + end + + @ldap = ldap + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ldap == o.ldap + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ldap].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/login_name.rb b/lib/zitadel/client/models/login_name.rb new file mode 100644 index 00000000..130272c1 --- /dev/null +++ b/lib/zitadel/client/models/login_name.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class LoginName + attr_accessor :login_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'login_name' => :'loginName' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'login_name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::LoginName` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::LoginName`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'login_name') + self.login_name = attributes[:'login_name'] + else + self.login_name = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @login_name.nil? + invalid_properties.push('invalid value for "login_name", login_name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @login_name.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] login_name Value to be assigned + def login_name=(login_name) + if login_name.nil? + fail ArgumentError, 'login_name cannot be nil' + end + + @login_name = login_name + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + login_name == o.login_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [login_name].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/login_name_query.rb b/lib/zitadel/client/models/login_name_query.rb new file mode 100644 index 00000000..c5f9ecb7 --- /dev/null +++ b/lib/zitadel/client/models/login_name_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class LoginNameQuery + attr_accessor :login_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'login_name_query' => :'loginNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'login_name_query' => :'UserServiceLoginNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::LoginNameQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::LoginNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'login_name_query') + self.login_name_query = attributes[:'login_name_query'] + else + self.login_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @login_name_query.nil? + invalid_properties.push('invalid value for "login_name_query", login_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @login_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceLoginNameQuery] login_name_query Value to be assigned + def login_name_query=(login_name_query) + if login_name_query.nil? + fail ArgumentError, 'login_name_query cannot be nil' + end + + @login_name_query = login_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + login_name_query == o.login_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [login_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/login_name_query1.rb b/lib/zitadel/client/models/login_name_query1.rb new file mode 100644 index 00000000..f4ee2171 --- /dev/null +++ b/lib/zitadel/client/models/login_name_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class LoginNameQuery1 + attr_accessor :login_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'login_name_query' => :'loginNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'login_name_query' => :'BetaUserServiceLoginNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::LoginNameQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::LoginNameQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'login_name_query') + self.login_name_query = attributes[:'login_name_query'] + else + self.login_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @login_name_query.nil? + invalid_properties.push('invalid value for "login_name_query", login_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @login_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceLoginNameQuery] login_name_query Value to be assigned + def login_name_query=(login_name_query) + if login_name_query.nil? + fail ArgumentError, 'login_name_query cannot be nil' + end + + @login_name_query = login_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + login_name_query == o.login_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [login_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/machine.rb b/lib/zitadel/client/models/machine.rb new file mode 100644 index 00000000..f03958fe --- /dev/null +++ b/lib/zitadel/client/models/machine.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Machine + attr_accessor :machine + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'machine' => :'machine' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'machine' => :'BetaUserServiceMachineUser' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Machine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Machine`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'machine') + self.machine = attributes[:'machine'] + else + self.machine = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @machine.nil? + invalid_properties.push('invalid value for "machine", machine cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @machine.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceMachineUser] machine Value to be assigned + def machine=(machine) + if machine.nil? + fail ArgumentError, 'machine cannot be nil' + end + + @machine = machine + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + machine == o.machine + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [machine].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/name_query.rb b/lib/zitadel/client/models/name_query.rb new file mode 100644 index 00000000..fb6ea92f --- /dev/null +++ b/lib/zitadel/client/models/name_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class NameQuery + attr_accessor :name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name_query' => :'nameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name_query' => :'OrganizationServiceOrganizationNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::NameQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::NameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name_query') + self.name_query = attributes[:'name_query'] + else + self.name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name_query.nil? + invalid_properties.push('invalid value for "name_query", name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [OrganizationServiceOrganizationNameQuery] name_query Value to be assigned + def name_query=(name_query) + if name_query.nil? + fail ArgumentError, 'name_query cannot be nil' + end + + @name_query = name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name_query == o.name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/nick_name_query.rb b/lib/zitadel/client/models/nick_name_query.rb new file mode 100644 index 00000000..1a41ac34 --- /dev/null +++ b/lib/zitadel/client/models/nick_name_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class NickNameQuery + attr_accessor :nick_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nick_name_query' => :'nickNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'nick_name_query' => :'UserServiceNickNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::NickNameQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::NickNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'nick_name_query') + self.nick_name_query = attributes[:'nick_name_query'] + else + self.nick_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @nick_name_query.nil? + invalid_properties.push('invalid value for "nick_name_query", nick_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @nick_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceNickNameQuery] nick_name_query Value to be assigned + def nick_name_query=(nick_name_query) + if nick_name_query.nil? + fail ArgumentError, 'nick_name_query cannot be nil' + end + + @nick_name_query = nick_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nick_name_query == o.nick_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [nick_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/nick_name_query1.rb b/lib/zitadel/client/models/nick_name_query1.rb new file mode 100644 index 00000000..2615211a --- /dev/null +++ b/lib/zitadel/client/models/nick_name_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class NickNameQuery1 + attr_accessor :nick_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nick_name_query' => :'nickNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'nick_name_query' => :'BetaUserServiceNickNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::NickNameQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::NickNameQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'nick_name_query') + self.nick_name_query = attributes[:'nick_name_query'] + else + self.nick_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @nick_name_query.nil? + invalid_properties.push('invalid value for "nick_name_query", nick_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @nick_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceNickNameQuery] nick_name_query Value to be assigned + def nick_name_query=(nick_name_query) + if nick_name_query.nil? + fail ArgumentError, 'nick_name_query cannot be nil' + end + + @nick_name_query = nick_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nick_name_query == o.nick_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [nick_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/not_query.rb b/lib/zitadel/client/models/not_query.rb new file mode 100644 index 00000000..3ec312f4 --- /dev/null +++ b/lib/zitadel/client/models/not_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class NotQuery + attr_accessor :not_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'not_query' => :'notQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'not_query' => :'UserServiceNotQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::NotQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::NotQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'not_query') + self.not_query = attributes[:'not_query'] + else + self.not_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @not_query.nil? + invalid_properties.push('invalid value for "not_query", not_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @not_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceNotQuery] not_query Value to be assigned + def not_query=(not_query) + if not_query.nil? + fail ArgumentError, 'not_query cannot be nil' + end + + @not_query = not_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + not_query == o.not_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [not_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/not_query1.rb b/lib/zitadel/client/models/not_query1.rb new file mode 100644 index 00000000..d1e708f3 --- /dev/null +++ b/lib/zitadel/client/models/not_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class NotQuery1 + attr_accessor :not_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'not_query' => :'notQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'not_query' => :'BetaUserServiceNotQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::NotQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::NotQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'not_query') + self.not_query = attributes[:'not_query'] + else + self.not_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @not_query.nil? + invalid_properties.push('invalid value for "not_query", not_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @not_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceNotQuery] not_query Value to be assigned + def not_query=(not_query) + if not_query.nil? + fail ArgumentError, 'not_query cannot be nil' + end + + @not_query = not_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + not_query == o.not_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [not_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/o_i_d_c_service_any.rb b/lib/zitadel/client/models/o_i_d_c_service_any.rb new file mode 100644 index 00000000..3f7d307e --- /dev/null +++ b/lib/zitadel/client/models/o_i_d_c_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class OIDCServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/o_i_d_c_service_auth_request.rb b/lib/zitadel/client/models/o_i_d_c_service_auth_request.rb index e264aeab..a5db6063 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_auth_request.rb +++ b/lib/zitadel/client/models/o_i_d_c_service_auth_request.rb @@ -15,34 +15,26 @@ module Zitadel::Client::Models class OIDCServiceAuthRequest - # ID of the authorization request attr_accessor :id - # Time when the auth request was created + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date - # OIDC client ID of the application that created the auth request attr_accessor :client_id - # Requested scopes by the application, which the user must consent to. attr_accessor :scope - # Base URI that points back to the application attr_accessor :redirect_uri - # Prompts that must be displayed to the user attr_accessor :prompt - # End-User's preferred languages and scripts for the user interface, represented as a list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value [fr-CA, fr, en] represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested locales are not supported. attr_accessor :ui_locales - # Login hint can be set by the application with a user identifier such as an email or phone number. attr_accessor :login_hint - # Specifies the allowable elapsed time in seconds since the last time the End-User was actively authenticated. If the elapsed time is greater than this value, or the field is present with 0 duration, the user must be re-authenticated. + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". attr_accessor :max_age - # User ID taken from a ID Token Hint if it was present and valid. attr_accessor :hint_user_id # Attribute mapping from ruby-style variable name to JSON key. @@ -90,6 +82,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'login_hint', + :'hint_user_id' ]) end diff --git a/lib/zitadel/client/models/user_service_email_query.rb b/lib/zitadel/client/models/o_i_d_c_service_connect_error.rb similarity index 76% rename from lib/zitadel/client/models/user_service_email_query.rb rename to lib/zitadel/client/models/o_i_d_c_service_connect_error.rb index f62341f1..f784c188 100644 --- a/lib/zitadel/client/models/user_service_email_query.rb +++ b/lib/zitadel/client/models/o_i_d_c_service_connect_error.rb @@ -14,12 +14,15 @@ require 'time' module Zitadel::Client::Models - # Query for users with a specific email. - class UserServiceEmailQuery - # email address of the user - attr_accessor :email_address + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class OIDCServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code - attr_accessor :method + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail class EnumAttributeValidator attr_reader :datatype @@ -46,8 +49,9 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'email_address' => :'emailAddress', - :'method' => :'method' + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' } end @@ -64,8 +68,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'email_address' => :'String', - :'method' => :'UserServiceTextQueryMethod' + :'code' => :'String', + :'message' => :'String', + :'detail' => :'OIDCServiceAny' } end @@ -80,7 +85,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceEmailQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceConnectError` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -88,21 +93,21 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceEmailQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - else - self.email_address = nil + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] end - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_QUERY_METHOD_EQUALS' + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] end end @@ -111,14 +116,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @email_address.nil? - invalid_properties.push('invalid value for "email_address", email_address cannot be nil.') - end - - if @email_address.to_s.length > 200 - invalid_properties.push('invalid value for "email_address", the character length must be smaller than or equal to 200.') - end - invalid_properties end @@ -126,23 +123,19 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @email_address.nil? - return false if @email_address.to_s.length > 200 + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) true end - # Custom attribute writer method with validation - # @param [Object] email_address Value to be assigned - def email_address=(email_address) - if email_address.nil? - fail ArgumentError, 'email_address cannot be nil' + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." end - - if email_address.to_s.length > 200 - fail ArgumentError, 'invalid value for "email_address", the character length must be smaller than or equal to 200.' - end - - @email_address = email_address + @code = code end # Checks equality by comparing each attribute. @@ -150,8 +143,9 @@ def email_address=(email_address) def ==(o) return true if self.equal?(o) self.class == o.class && - email_address == o.email_address && - method == o.method + code == o.code && + message == o.message && + detail == o.detail end # @see the `==` method @@ -163,7 +157,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email_address, method].hash + [code, message, detail].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/o_i_d_c_service_create_callback_response.rb b/lib/zitadel/client/models/o_i_d_c_service_create_callback_response.rb index 2883d8b2..0e268c04 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_create_callback_response.rb +++ b/lib/zitadel/client/models/o_i_d_c_service_create_callback_response.rb @@ -17,7 +17,6 @@ module Zitadel::Client::Models class OIDCServiceCreateCallbackResponse attr_accessor :details - # Callback URL where the user should be redirected, using a \"302 FOUND\" status. Contains details for the application to obtain the tokens on success, or error details on failure. Note that this field must be treated as credentials, as the contained code can be used to obtain tokens on behalve of the user. attr_accessor :callback_url # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/o_i_d_c_service_details.rb b/lib/zitadel/client/models/o_i_d_c_service_details.rb index 8153947b..e596ea29 100644 --- a/lib/zitadel/client/models/o_i_d_c_service_details.rb +++ b/lib/zitadel/client/models/o_i_d_c_service_details.rb @@ -15,14 +15,16 @@ module Zitadel::Client::Models class OIDCServiceDetails - # on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation attr_accessor :sequence - # on read: the timestamp of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date + # resource_owner is the organization or instance_id an object belongs to attr_accessor :resource_owner + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date # Attribute mapping from ruby-style variable name to JSON key. @@ -48,7 +50,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'sequence' => :'String', + :'sequence' => :'Object', :'change_date' => :'Time', :'resource_owner' => :'String', :'creation_date' => :'Time' @@ -58,6 +60,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/o_i_d_c_service_error_reason.rb b/lib/zitadel/client/models/o_i_d_c_service_error_reason.rb deleted file mode 100644 index 559d0051..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_error_reason.rb +++ /dev/null @@ -1,56 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceErrorReason - ERROR_REASON_UNSPECIFIED = "ERROR_REASON_UNSPECIFIED".freeze - ERROR_REASON_INVALID_REQUEST = "ERROR_REASON_INVALID_REQUEST".freeze - ERROR_REASON_UNAUTHORIZED_CLIENT = "ERROR_REASON_UNAUTHORIZED_CLIENT".freeze - ERROR_REASON_ACCESS_DENIED = "ERROR_REASON_ACCESS_DENIED".freeze - ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = "ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE".freeze - ERROR_REASON_INVALID_SCOPE = "ERROR_REASON_INVALID_SCOPE".freeze - ERROR_REASON_SERVER_ERROR = "ERROR_REASON_SERVER_ERROR".freeze - ERROR_REASON_TEMPORARY_UNAVAILABLE = "ERROR_REASON_TEMPORARY_UNAVAILABLE".freeze - ERROR_REASON_INTERACTION_REQUIRED = "ERROR_REASON_INTERACTION_REQUIRED".freeze - ERROR_REASON_LOGIN_REQUIRED = "ERROR_REASON_LOGIN_REQUIRED".freeze - ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = "ERROR_REASON_ACCOUNT_SELECTION_REQUIRED".freeze - ERROR_REASON_CONSENT_REQUIRED = "ERROR_REASON_CONSENT_REQUIRED".freeze - ERROR_REASON_INVALID_REQUEST_URI = "ERROR_REASON_INVALID_REQUEST_URI".freeze - ERROR_REASON_INVALID_REQUEST_OBJECT = "ERROR_REASON_INVALID_REQUEST_OBJECT".freeze - ERROR_REASON_REQUEST_NOT_SUPPORTED = "ERROR_REASON_REQUEST_NOT_SUPPORTED".freeze - ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = "ERROR_REASON_REQUEST_URI_NOT_SUPPORTED".freeze - ERROR_REASON_REGISTRATION_NOT_SUPPORTED = "ERROR_REASON_REGISTRATION_NOT_SUPPORTED".freeze - - def self.all_vars - @all_vars ||= [ERROR_REASON_UNSPECIFIED, ERROR_REASON_INVALID_REQUEST, ERROR_REASON_UNAUTHORIZED_CLIENT, ERROR_REASON_ACCESS_DENIED, ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE, ERROR_REASON_INVALID_SCOPE, ERROR_REASON_SERVER_ERROR, ERROR_REASON_TEMPORARY_UNAVAILABLE, ERROR_REASON_INTERACTION_REQUIRED, ERROR_REASON_LOGIN_REQUIRED, ERROR_REASON_ACCOUNT_SELECTION_REQUIRED, ERROR_REASON_CONSENT_REQUIRED, ERROR_REASON_INVALID_REQUEST_URI, ERROR_REASON_INVALID_REQUEST_OBJECT, ERROR_REASON_REQUEST_NOT_SUPPORTED, ERROR_REASON_REQUEST_URI_NOT_SUPPORTED, ERROR_REASON_REGISTRATION_NOT_SUPPORTED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OIDCServiceErrorReason.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OIDCServiceErrorReason" - end - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_request.rb b/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_request.rb new file mode 100644 index 00000000..bc39bbf5 --- /dev/null +++ b/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class OIDCServiceGetAuthRequestRequest + attr_accessor :auth_request_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'auth_request_id' => :'authRequestId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'auth_request_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceGetAuthRequestRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceGetAuthRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'auth_request_id') + self.auth_request_id = attributes[:'auth_request_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth_request_id == o.auth_request_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [auth_request_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_request.rb b/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_request.rb new file mode 100644 index 00000000..11933812 --- /dev/null +++ b/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_request.rb @@ -0,0 +1,231 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class OIDCServiceGetDeviceAuthorizationRequestRequest + # The user_code returned by the device authorization request and provided to the user by the device. + attr_accessor :user_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_code' => :'userCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceGetDeviceAuthorizationRequestRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceGetDeviceAuthorizationRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_code') + self.user_code = attributes[:'user_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_code == o.user_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/oauth.rb b/lib/zitadel/client/models/oauth.rb new file mode 100644 index 00000000..4930d672 --- /dev/null +++ b/lib/zitadel/client/models/oauth.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Oauth + attr_accessor :oauth + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth' => :'oauth' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth' => :'IdentityProviderServiceOAuthConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Oauth` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Oauth`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'oauth') + self.oauth = attributes[:'oauth'] + else + self.oauth = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @oauth.nil? + invalid_properties.push('invalid value for "oauth", oauth cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @oauth.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceOAuthConfig] oauth Value to be assigned + def oauth=(oauth) + if oauth.nil? + fail ArgumentError, 'oauth cannot be nil' + end + + @oauth = oauth + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oauth == o.oauth + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [oauth].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/oauth1.rb b/lib/zitadel/client/models/oauth1.rb new file mode 100644 index 00000000..b87a590b --- /dev/null +++ b/lib/zitadel/client/models/oauth1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Oauth1 + attr_accessor :oauth + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth' => :'oauth' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth' => :'UserServiceIDPOAuthAccessInformation' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Oauth1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Oauth1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'oauth') + self.oauth = attributes[:'oauth'] + else + self.oauth = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @oauth.nil? + invalid_properties.push('invalid value for "oauth", oauth cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @oauth.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceIDPOAuthAccessInformation] oauth Value to be assigned + def oauth=(oauth) + if oauth.nil? + fail ArgumentError, 'oauth cannot be nil' + end + + @oauth = oauth + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oauth == o.oauth + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [oauth].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/oauth2.rb b/lib/zitadel/client/models/oauth2.rb new file mode 100644 index 00000000..7a71e627 --- /dev/null +++ b/lib/zitadel/client/models/oauth2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Oauth2 + attr_accessor :oauth + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oauth' => :'oauth' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'oauth' => :'BetaUserServiceIDPOAuthAccessInformation' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Oauth2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Oauth2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'oauth') + self.oauth = attributes[:'oauth'] + else + self.oauth = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @oauth.nil? + invalid_properties.push('invalid value for "oauth", oauth cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @oauth.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceIDPOAuthAccessInformation] oauth Value to be assigned + def oauth=(oauth) + if oauth.nil? + fail ArgumentError, 'oauth cannot be nil' + end + + @oauth = oauth + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oauth == o.oauth + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [oauth].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/oidc.rb b/lib/zitadel/client/models/oidc.rb new file mode 100644 index 00000000..eb128b30 --- /dev/null +++ b/lib/zitadel/client/models/oidc.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Oidc + attr_accessor :oidc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oidc' => :'oidc' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'oidc' => :'IdentityProviderServiceGenericOIDCConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Oidc` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Oidc`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'oidc') + self.oidc = attributes[:'oidc'] + else + self.oidc = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @oidc.nil? + invalid_properties.push('invalid value for "oidc", oidc cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @oidc.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceGenericOIDCConfig] oidc Value to be assigned + def oidc=(oidc) + if oidc.nil? + fail ArgumentError, 'oidc cannot be nil' + end + + @oidc = oidc + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oidc == o.oidc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [oidc].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rb b/lib/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rb new file mode 100644 index 00000000..3c9d3e58 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Deny', + :'Session' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/oidc_service_create_callback_request.rb b/lib/zitadel/client/models/oidc_service_create_callback_request.rb new file mode 100644 index 00000000..ed417f0f --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_create_callback_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module OIDCServiceCreateCallbackRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Error', + :'Session' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/or_query.rb b/lib/zitadel/client/models/or_query.rb new file mode 100644 index 00000000..551269d1 --- /dev/null +++ b/lib/zitadel/client/models/or_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class OrQuery + attr_accessor :or_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'or_query' => :'orQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'or_query' => :'UserServiceOrQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'or_query') + self.or_query = attributes[:'or_query'] + else + self.or_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @or_query.nil? + invalid_properties.push('invalid value for "or_query", or_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @or_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceOrQuery] or_query Value to be assigned + def or_query=(or_query) + if or_query.nil? + fail ArgumentError, 'or_query cannot be nil' + end + + @or_query = or_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + or_query == o.or_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [or_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/or_query1.rb b/lib/zitadel/client/models/or_query1.rb new file mode 100644 index 00000000..7b79f0a2 --- /dev/null +++ b/lib/zitadel/client/models/or_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class OrQuery1 + attr_accessor :or_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'or_query' => :'orQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'or_query' => :'BetaUserServiceOrQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'or_query') + self.or_query = attributes[:'or_query'] + else + self.or_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @or_query.nil? + invalid_properties.push('invalid value for "or_query", or_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @or_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceOrQuery] or_query Value to be assigned + def or_query=(or_query) + if or_query.nil? + fail ArgumentError, 'or_query cannot be nil' + end + + @or_query = or_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + or_query == o.or_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [or_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/zitadelobjectv2_organization.rb b/lib/zitadel/client/models/org_domain.rb similarity index 90% rename from lib/zitadel/client/models/zitadelobjectv2_organization.rb rename to lib/zitadel/client/models/org_domain.rb index 1e58f140..9dc5be2f 100644 --- a/lib/zitadel/client/models/zitadelobjectv2_organization.rb +++ b/lib/zitadel/client/models/org_domain.rb @@ -14,15 +14,12 @@ require 'time' module Zitadel::Client::Models - class Zitadelobjectv2Organization - attr_accessor :org_id - + class OrgDomain attr_accessor :org_domain # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'org_id' => :'orgId', :'org_domain' => :'orgDomain' } end @@ -40,7 +37,6 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'org_id' => :'String', :'org_domain' => :'String' } end @@ -56,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Zitadelobjectv2Organization` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrgDomain` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Zitadelobjectv2Organization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrgDomain`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - if attributes.key?(:'org_domain') self.org_domain = attributes[:'org_domain'] + else + self.org_domain = nil end end @@ -83,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @org_domain.nil? + invalid_properties.push('invalid value for "org_domain", org_domain cannot be nil.') + end + invalid_properties end @@ -90,15 +88,25 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @org_domain.nil? true end + # Custom attribute writer method with validation + # @param [String] org_domain Value to be assigned + def org_domain=(org_domain) + if org_domain.nil? + fail ArgumentError, 'org_domain cannot be nil' + end + + @org_domain = org_domain + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - org_id == o.org_id && org_domain == o.org_domain end @@ -111,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [org_id, org_domain].hash + [org_domain].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/org_id.rb b/lib/zitadel/client/models/org_id.rb new file mode 100644 index 00000000..b6068b2a --- /dev/null +++ b/lib/zitadel/client/models/org_id.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class OrgId + attr_accessor :org_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'org_id' => :'orgId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'org_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrgId` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrgId`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + else + self.org_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @org_id.nil? + invalid_properties.push('invalid value for "org_id", org_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @org_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] org_id Value to be assigned + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'org_id cannot be nil' + end + + @org_id = org_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + org_id == o.org_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [org_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_not_query.rb b/lib/zitadel/client/models/organization_id_query.rb similarity index 85% rename from lib/zitadel/client/models/user_service_not_query.rb rename to lib/zitadel/client/models/organization_id_query.rb index 1ab607a5..d3147d1b 100644 --- a/lib/zitadel/client/models/user_service_not_query.rb +++ b/lib/zitadel/client/models/organization_id_query.rb @@ -14,14 +14,13 @@ require 'time' module Zitadel::Client::Models - # Negate the sub-condition. - class UserServiceNotQuery - attr_accessor :query + class OrganizationIdQuery + attr_accessor :organization_id_query # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'query' => :'query' + :'organization_id_query' => :'organizationIdQuery' } end @@ -38,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'query' => :'UserServiceSearchQuery' + :'organization_id_query' => :'UserServiceOrganizationIdQuery' } end @@ -53,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceNotQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationIdQuery` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceNotQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationIdQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'query') - self.query = attributes[:'query'] + if attributes.key?(:'organization_id_query') + self.organization_id_query = attributes[:'organization_id_query'] + else + self.organization_id_query = nil end end @@ -76,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @organization_id_query.nil? + invalid_properties.push('invalid value for "organization_id_query", organization_id_query cannot be nil.') + end + invalid_properties end @@ -83,15 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @organization_id_query.nil? true end + # Custom attribute writer method with validation + # @param [UserServiceOrganizationIdQuery] organization_id_query Value to be assigned + def organization_id_query=(organization_id_query) + if organization_id_query.nil? + fail ArgumentError, 'organization_id_query cannot be nil' + end + + @organization_id_query = organization_id_query + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - query == o.query + organization_id_query == o.organization_id_query end # @see the `==` method @@ -103,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [query].hash + [organization_id_query].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/web_key_service_beta_r_s_a.rb b/lib/zitadel/client/models/organization_id_query1.rb similarity index 85% rename from lib/zitadel/client/models/web_key_service_beta_r_s_a.rb rename to lib/zitadel/client/models/organization_id_query1.rb index 21eb5539..28f6a229 100644 --- a/lib/zitadel/client/models/web_key_service_beta_r_s_a.rb +++ b/lib/zitadel/client/models/organization_id_query1.rb @@ -14,38 +14,13 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceBetaRSA - attr_accessor :bits - - attr_accessor :hasher - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end + class OrganizationIdQuery1 + attr_accessor :organization_id_query # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'bits' => :'bits', - :'hasher' => :'hasher' + :'organization_id_query' => :'organizationIdQuery' } end @@ -62,8 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'bits' => :'WebKeyServiceBetaRSABits', - :'hasher' => :'WebKeyServiceBetaRSAHasher' + :'organization_id_query' => :'BetaUserServiceOrganizationIdQuery' } end @@ -78,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceBetaRSA` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationIdQuery1` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -86,21 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceBetaRSA`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationIdQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'bits') - self.bits = attributes[:'bits'] + if attributes.key?(:'organization_id_query') + self.organization_id_query = attributes[:'organization_id_query'] else - self.bits = 'RSA_BITS_UNSPECIFIED' - end - - if attributes.key?(:'hasher') - self.hasher = attributes[:'hasher'] - else - self.hasher = 'RSA_HASHER_UNSPECIFIED' + self.organization_id_query = nil end end @@ -109,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @organization_id_query.nil? + invalid_properties.push('invalid value for "organization_id_query", organization_id_query cannot be nil.') + end + invalid_properties end @@ -116,16 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @organization_id_query.nil? true end + # Custom attribute writer method with validation + # @param [BetaUserServiceOrganizationIdQuery] organization_id_query Value to be assigned + def organization_id_query=(organization_id_query) + if organization_id_query.nil? + fail ArgumentError, 'organization_id_query cannot be nil' + end + + @organization_id_query = organization_id_query + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - bits == o.bits && - hasher == o.hasher + organization_id_query == o.organization_id_query end # @see the `==` method @@ -137,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [bits, hasher].hash + [organization_id_query].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/organization_service_add_human_user_request.rb b/lib/zitadel/client/models/organization_service_add_human_user_request.rb deleted file mode 100644 index dd4838c1..00000000 --- a/lib/zitadel/client/models/organization_service_add_human_user_request.rb +++ /dev/null @@ -1,445 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OrganizationServiceAddHumanUserRequest - # optionally set your own id unique for the user. - attr_accessor :user_id - - # optionally set a unique username, if none is provided the email will be used. - attr_accessor :username - - attr_accessor :organization - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :metadata - - attr_accessor :password - - attr_accessor :hashed_password - - attr_accessor :idp_links - - # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. - attr_accessor :totp_secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'organization' => :'organization', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'metadata' => :'metadata', - :'password' => :'password', - :'hashed_password' => :'hashedPassword', - :'idp_links' => :'idpLinks', - :'totp_secret' => :'totpSecret' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'organization' => :'Zitadelobjectv2Organization', - :'profile' => :'OrganizationServiceSetHumanProfile', - :'email' => :'OrganizationServiceSetHumanEmail', - :'phone' => :'OrganizationServiceSetHumanPhone', - :'metadata' => :'Array', - :'password' => :'OrganizationServicePassword', - :'hashed_password' => :'OrganizationServiceHashedPassword', - :'idp_links' => :'Array', - :'totp_secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAddHumanUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAddHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - else - self.profile = nil - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - else - self.email = nil - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'hashed_password') - self.hashed_password = attributes[:'hashed_password'] - end - - if attributes.key?(:'idp_links') - if (value = attributes[:'idp_links']).is_a?(Array) - self.idp_links = value - end - end - - if attributes.key?(:'totp_secret') - self.totp_secret = attributes[:'totp_secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@user_id.nil? && @user_id.to_s.length > 200 - invalid_properties.push('invalid value for "user_id", the character length must be smaller than or equal to 200.') - end - - if !@user_id.nil? && @user_id.to_s.length < 1 - invalid_properties.push('invalid value for "user_id", the character length must be great than or equal to 1.') - end - - if !@username.nil? && @username.to_s.length > 200 - invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 200.') - end - - if !@username.nil? && @username.to_s.length < 1 - invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.') - end - - if @profile.nil? - invalid_properties.push('invalid value for "profile", profile cannot be nil.') - end - - if @email.nil? - invalid_properties.push('invalid value for "email", email cannot be nil.') - end - - if !@totp_secret.nil? && @totp_secret.to_s.length > 200 - invalid_properties.push('invalid value for "totp_secret", the character length must be smaller than or equal to 200.') - end - - if !@totp_secret.nil? && @totp_secret.to_s.length < 1 - invalid_properties.push('invalid value for "totp_secret", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@user_id.nil? && @user_id.to_s.length > 200 - return false if !@user_id.nil? && @user_id.to_s.length < 1 - return false if !@username.nil? && @username.to_s.length > 200 - return false if !@username.nil? && @username.to_s.length < 1 - return false if @profile.nil? - return false if @email.nil? - return false if !@totp_secret.nil? && @totp_secret.to_s.length > 200 - return false if !@totp_secret.nil? && @totp_secret.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] user_id Value to be assigned - def user_id=(user_id) - if user_id.nil? - fail ArgumentError, 'user_id cannot be nil' - end - - if user_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_id", the character length must be smaller than or equal to 200.' - end - - if user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "user_id", the character length must be great than or equal to 1.' - end - - @user_id = user_id - end - - # Custom attribute writer method with validation - # @param [Object] username Value to be assigned - def username=(username) - if username.nil? - fail ArgumentError, 'username cannot be nil' - end - - if username.to_s.length > 200 - fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 200.' - end - - if username.to_s.length < 1 - fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.' - end - - @username = username - end - - # Custom attribute writer method with validation - # @param [Object] profile Value to be assigned - def profile=(profile) - if profile.nil? - fail ArgumentError, 'profile cannot be nil' - end - - @profile = profile - end - - # Custom attribute writer method with validation - # @param [Object] email Value to be assigned - def email=(email) - if email.nil? - fail ArgumentError, 'email cannot be nil' - end - - @email = email - end - - # Custom attribute writer method with validation - # @param [Object] totp_secret Value to be assigned - def totp_secret=(totp_secret) - if totp_secret.nil? - fail ArgumentError, 'totp_secret cannot be nil' - end - - if totp_secret.to_s.length > 200 - fail ArgumentError, 'invalid value for "totp_secret", the character length must be smaller than or equal to 200.' - end - - if totp_secret.to_s.length < 1 - fail ArgumentError, 'invalid value for "totp_secret", the character length must be great than or equal to 1.' - end - - @totp_secret = totp_secret - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - organization == o.organization && - profile == o.profile && - email == o.email && - phone == o.phone && - metadata == o.metadata && - password == o.password && - hashed_password == o.hashed_password && - idp_links == o.idp_links && - totp_secret == o.totp_secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, organization, profile, email, phone, metadata, password, hashed_password, idp_links, totp_secret].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/organization_service_add_organization_request.rb b/lib/zitadel/client/models/organization_service_add_organization_request.rb index 4e94397e..731bf2f0 100644 --- a/lib/zitadel/client/models/organization_service_add_organization_request.rb +++ b/lib/zitadel/client/models/organization_service_add_organization_request.rb @@ -41,7 +41,7 @@ def self.acceptable_attributes def self.openapi_types { :'name' => :'String', - :'admins' => :'Array' + :'admins' => :'Array' } end @@ -91,14 +91,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "name", name cannot be nil.') end - if @name.to_s.length > 200 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.') - end - - if @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -107,26 +99,16 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? - return false if @name.to_s.length > 200 - return false if @name.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] name Value to be assigned + # @param [String] name Value to be assigned def name=(name) if name.nil? fail ArgumentError, 'name cannot be nil' end - if name.to_s.length > 200 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - @name = name end diff --git a/lib/zitadel/client/models/organization_service_add_organization_response.rb b/lib/zitadel/client/models/organization_service_add_organization_response.rb index 138e04c4..634cceb6 100644 --- a/lib/zitadel/client/models/organization_service_add_organization_response.rb +++ b/lib/zitadel/client/models/organization_service_add_organization_response.rb @@ -45,7 +45,7 @@ def self.openapi_types { :'details' => :'OrganizationServiceDetails', :'organization_id' => :'String', - :'created_admins' => :'Array' + :'created_admins' => :'Array' } end diff --git a/lib/zitadel/client/models/organization_service_admin.rb b/lib/zitadel/client/models/organization_service_admin.rb new file mode 100644 index 00000000..1ca755dc --- /dev/null +++ b/lib/zitadel/client/models/organization_service_admin.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module OrganizationServiceAdmin + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Human', + :'UserId' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/user_service_protobuf_any.rb b/lib/zitadel/client/models/organization_service_any.rb similarity index 88% rename from lib/zitadel/client/models/user_service_protobuf_any.rb rename to lib/zitadel/client/models/organization_service_any.rb index f4f105db..97fbcec5 100644 --- a/lib/zitadel/client/models/user_service_protobuf_any.rb +++ b/lib/zitadel/client/models/organization_service_any.rb @@ -14,13 +14,20 @@ require 'time' module Zitadel::Client::Models - class UserServiceProtobufAny + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class OrganizationServiceAny attr_accessor :type + attr_accessor :value + + attr_accessor :debug + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' } end @@ -37,7 +44,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' } end @@ -52,7 +61,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAny` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,7 +69,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -68,6 +77,16 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -90,7 +109,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + type == o.type && + value == o.value && + debug == o.debug end # @see the `==` method @@ -102,7 +123,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [type, value, debug].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/organization_service_connect_error.rb b/lib/zitadel/client/models/organization_service_connect_error.rb new file mode 100644 index 00000000..c8927309 --- /dev/null +++ b/lib/zitadel/client/models/organization_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class OrganizationServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'OrganizationServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_created_admin.rb b/lib/zitadel/client/models/organization_service_created_admin.rb new file mode 100644 index 00000000..3d40d8f1 --- /dev/null +++ b/lib/zitadel/client/models/organization_service_created_admin.rb @@ -0,0 +1,250 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class OrganizationServiceCreatedAdmin + attr_accessor :user_id + + attr_accessor :email_code + + attr_accessor :phone_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'email_code' => :'emailCode', + :'phone_code' => :'phoneCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'email_code' => :'String', + :'phone_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'email_code', + :'phone_code' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceCreatedAdmin` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceCreatedAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'email_code') + self.email_code = attributes[:'email_code'] + end + + if attributes.key?(:'phone_code') + self.phone_code = attributes[:'phone_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + email_code == o.email_code && + phone_code == o.phone_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, email_code, phone_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/organization_service_details.rb b/lib/zitadel/client/models/organization_service_details.rb index 4b8d6a89..71bb6564 100644 --- a/lib/zitadel/client/models/organization_service_details.rb +++ b/lib/zitadel/client/models/organization_service_details.rb @@ -15,14 +15,16 @@ module Zitadel::Client::Models class OrganizationServiceDetails - # on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation attr_accessor :sequence - # on read: the timestamp of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date + # resource_owner is the organization or instance_id an object belongs to attr_accessor :resource_owner + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date # Attribute mapping from ruby-style variable name to JSON key. @@ -48,7 +50,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'sequence' => :'String', + :'sequence' => :'Object', :'change_date' => :'Time', :'resource_owner' => :'String', :'creation_date' => :'Time' @@ -58,6 +60,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/organization_service_list_details.rb b/lib/zitadel/client/models/organization_service_list_details.rb index 5ffd426f..f46dbfa8 100644 --- a/lib/zitadel/client/models/organization_service_list_details.rb +++ b/lib/zitadel/client/models/organization_service_list_details.rb @@ -19,7 +19,7 @@ class OrganizationServiceListDetails attr_accessor :processed_sequence - # the last time the projection got updated + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :timestamp # Attribute mapping from ruby-style variable name to JSON key. @@ -44,8 +44,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'total_result' => :'String', - :'processed_sequence' => :'String', + :'total_result' => :'Object', + :'processed_sequence' => :'Object', :'timestamp' => :'Time' } end @@ -53,6 +53,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'total_result', + :'processed_sequence', ]) end diff --git a/lib/zitadel/client/models/organization_service_list_organizations_request.rb b/lib/zitadel/client/models/organization_service_list_organizations_request.rb index 978396f0..74a371ff 100644 --- a/lib/zitadel/client/models/organization_service_list_organizations_request.rb +++ b/lib/zitadel/client/models/organization_service_list_organizations_request.rb @@ -19,6 +19,7 @@ class OrganizationServiceListOrganizationsRequest attr_accessor :sorting_column + # criteria the client is looking for attr_accessor :queries class EnumAttributeValidator @@ -101,8 +102,6 @@ def initialize(attributes = {}) if attributes.key?(:'sorting_column') self.sorting_column = attributes[:'sorting_column'] - else - self.sorting_column = 'ORGANIZATION_FIELD_NAME_UNSPECIFIED' end if attributes.key?(:'queries') diff --git a/lib/zitadel/client/models/organization_service_list_organizations_response.rb b/lib/zitadel/client/models/organization_service_list_organizations_response.rb index 0dc2d308..4f1cbbf9 100644 --- a/lib/zitadel/client/models/organization_service_list_organizations_response.rb +++ b/lib/zitadel/client/models/organization_service_list_organizations_response.rb @@ -67,7 +67,7 @@ def self.openapi_types { :'details' => :'OrganizationServiceListDetails', :'sorting_column' => :'OrganizationServiceOrganizationFieldName', - :'result' => :'Array' + :'result' => :'Array' } end @@ -101,8 +101,6 @@ def initialize(attributes = {}) if attributes.key?(:'sorting_column') self.sorting_column = attributes[:'sorting_column'] - else - self.sorting_column = 'ORGANIZATION_FIELD_NAME_UNSPECIFIED' end if attributes.key?(:'result') diff --git a/lib/zitadel/client/models/organization_service_list_query.rb b/lib/zitadel/client/models/organization_service_list_query.rb index 23b0f181..faccd65e 100644 --- a/lib/zitadel/client/models/organization_service_list_query.rb +++ b/lib/zitadel/client/models/organization_service_list_query.rb @@ -14,14 +14,11 @@ require 'time' module Zitadel::Client::Models - # Object unspecific list filters like offset, limit and asc/desc. class OrganizationServiceListQuery attr_accessor :offset - # Maximum amount of events returned. The default is set to 1000 in https://github.com/zitadel/zitadel/blob/new-eventstore/cmd/zitadel/startup.yaml. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. attr_accessor :limit - # default is descending attr_accessor :asc # Attribute mapping from ruby-style variable name to JSON key. @@ -46,7 +43,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'offset' => :'String', + :'offset' => :'Object', :'limit' => :'Integer', :'asc' => :'Boolean' } @@ -55,6 +52,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'offset', ]) end diff --git a/lib/zitadel/client/models/zitadelorgv2_organization.rb b/lib/zitadel/client/models/organization_service_organization.rb similarity index 96% rename from lib/zitadel/client/models/zitadelorgv2_organization.rb rename to lib/zitadel/client/models/organization_service_organization.rb index f8727a95..fc54e9c2 100644 --- a/lib/zitadel/client/models/zitadelorgv2_organization.rb +++ b/lib/zitadel/client/models/organization_service_organization.rb @@ -14,7 +14,7 @@ require 'time' module Zitadel::Client::Models - class Zitadelorgv2Organization + class OrganizationServiceOrganization # Unique identifier of the organization. attr_accessor :id @@ -93,7 +93,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Zitadelorgv2Organization` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganization` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -101,7 +101,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Zitadelorgv2Organization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -116,8 +116,6 @@ def initialize(attributes = {}) if attributes.key?(:'state') self.state = attributes[:'state'] - else - self.state = 'ORGANIZATION_STATE_UNSPECIFIED' end if attributes.key?(:'name') diff --git a/lib/zitadel/client/models/organization_service_search_query.rb b/lib/zitadel/client/models/organization_service_search_query.rb index e6efd29b..3e8fa138 100644 --- a/lib/zitadel/client/models/organization_service_search_query.rb +++ b/lib/zitadel/client/models/organization_service_search_query.rb @@ -14,253 +14,100 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceSearchQuery - attr_accessor :name_query - - attr_accessor :domain_query - - attr_accessor :state_query - - attr_accessor :id_query - - attr_accessor :default_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name_query' => :'nameQuery', - :'domain_query' => :'domainQuery', - :'state_query' => :'stateQuery', - :'id_query' => :'idQuery', - :'default_query' => :'defaultQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name_query' => :'OrganizationServiceOrganizationNameQuery', - :'domain_query' => :'OrganizationServiceOrganizationDomainQuery', - :'state_query' => :'OrganizationServiceOrganizationStateQuery', - :'id_query' => :'OrganizationServiceOrganizationIDQuery', - :'default_query' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module OrganizationServiceSearchQuery + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'DefaultQuery', + :'DomainQuery', + :'IdQuery', + :'NameQuery', + :'StateQuery1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'name_query') - self.name_query = attributes[:'name_query'] - end - - if attributes.key?(:'domain_query') - self.domain_query = attributes[:'domain_query'] - end - - if attributes.key?(:'state_query') - self.state_query = attributes[:'state_query'] - end - - if attributes.key?(:'id_query') - self.id_query = attributes[:'id_query'] end - if attributes.key?(:'default_query') - self.default_query = attributes[:'default_query'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name_query == o.name_query && - domain_query == o.domain_query && - state_query == o.state_query && - id_query == o.id_query && - default_query == o.default_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name_query, domain_query, state_query, id_query, default_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_set_human_email.rb b/lib/zitadel/client/models/organization_service_set_human_email.rb deleted file mode 100644 index 319a29ee..00000000 --- a/lib/zitadel/client/models/organization_service_set_human_email.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSetHumanEmail - attr_accessor :email - - attr_accessor :send_code - - attr_accessor :return_code - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'send_code' => :'sendCode', - :'return_code' => :'returnCode', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'send_code' => :'OrganizationServiceSendEmailVerificationCode', - :'return_code' => :'Object', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetHumanEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetHumanEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - else - self.email = nil - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @email.nil? - invalid_properties.push('invalid value for "email", email cannot be nil.') - end - - if @email.to_s.length > 200 - invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 200.') - end - - if @email.to_s.length < 1 - invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @email.nil? - return false if @email.to_s.length > 200 - return false if @email.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] email Value to be assigned - def email=(email) - if email.nil? - fail ArgumentError, 'email cannot be nil' - end - - if email.to_s.length > 200 - fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 200.' - end - - if email.to_s.length < 1 - fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' - end - - @email = email - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - send_code == o.send_code && - return_code == o.return_code && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, send_code, return_code, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/organization_service_set_human_profile.rb b/lib/zitadel/client/models/organization_service_set_human_profile.rb deleted file mode 100644 index 5a7b5a4d..00000000 --- a/lib/zitadel/client/models/organization_service_set_human_profile.rb +++ /dev/null @@ -1,426 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSetHumanProfile - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :nick_name - - attr_accessor :display_name - - attr_accessor :preferred_language - - attr_accessor :gender - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'givenName', - :'family_name' => :'familyName', - :'nick_name' => :'nickName', - :'display_name' => :'displayName', - :'preferred_language' => :'preferredLanguage', - :'gender' => :'gender' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'nick_name' => :'String', - :'display_name' => :'String', - :'preferred_language' => :'String', - :'gender' => :'OrganizationServiceGender' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetHumanProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetHumanProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - else - self.given_name = nil - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - else - self.family_name = nil - end - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'preferred_language') - self.preferred_language = attributes[:'preferred_language'] - end - - if attributes.key?(:'gender') - self.gender = attributes[:'gender'] - else - self.gender = 'GENDER_UNSPECIFIED' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @given_name.nil? - invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') - end - - if @given_name.to_s.length > 200 - invalid_properties.push('invalid value for "given_name", the character length must be smaller than or equal to 200.') - end - - if @given_name.to_s.length < 1 - invalid_properties.push('invalid value for "given_name", the character length must be great than or equal to 1.') - end - - if @family_name.nil? - invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') - end - - if @family_name.to_s.length > 200 - invalid_properties.push('invalid value for "family_name", the character length must be smaller than or equal to 200.') - end - - if @family_name.to_s.length < 1 - invalid_properties.push('invalid value for "family_name", the character length must be great than or equal to 1.') - end - - if !@nick_name.nil? && @nick_name.to_s.length > 200 - invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 200.') - end - - if !@display_name.nil? && @display_name.to_s.length > 200 - invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 200.') - end - - if !@preferred_language.nil? && @preferred_language.to_s.length > 10 - invalid_properties.push('invalid value for "preferred_language", the character length must be smaller than or equal to 10.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @given_name.nil? - return false if @given_name.to_s.length > 200 - return false if @given_name.to_s.length < 1 - return false if @family_name.nil? - return false if @family_name.to_s.length > 200 - return false if @family_name.to_s.length < 1 - return false if !@nick_name.nil? && @nick_name.to_s.length > 200 - return false if !@display_name.nil? && @display_name.to_s.length > 200 - return false if !@preferred_language.nil? && @preferred_language.to_s.length > 10 - true - end - - # Custom attribute writer method with validation - # @param [Object] given_name Value to be assigned - def given_name=(given_name) - if given_name.nil? - fail ArgumentError, 'given_name cannot be nil' - end - - if given_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "given_name", the character length must be smaller than or equal to 200.' - end - - if given_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "given_name", the character length must be great than or equal to 1.' - end - - @given_name = given_name - end - - # Custom attribute writer method with validation - # @param [Object] family_name Value to be assigned - def family_name=(family_name) - if family_name.nil? - fail ArgumentError, 'family_name cannot be nil' - end - - if family_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "family_name", the character length must be smaller than or equal to 200.' - end - - if family_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "family_name", the character length must be great than or equal to 1.' - end - - @family_name = family_name - end - - # Custom attribute writer method with validation - # @param [Object] nick_name Value to be assigned - def nick_name=(nick_name) - if nick_name.nil? - fail ArgumentError, 'nick_name cannot be nil' - end - - if nick_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 200.' - end - - @nick_name = nick_name - end - - # Custom attribute writer method with validation - # @param [Object] display_name Value to be assigned - def display_name=(display_name) - if display_name.nil? - fail ArgumentError, 'display_name cannot be nil' - end - - if display_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 200.' - end - - @display_name = display_name - end - - # Custom attribute writer method with validation - # @param [Object] preferred_language Value to be assigned - def preferred_language=(preferred_language) - if preferred_language.nil? - fail ArgumentError, 'preferred_language cannot be nil' - end - - if preferred_language.to_s.length > 10 - fail ArgumentError, 'invalid value for "preferred_language", the character length must be smaller than or equal to 10.' - end - - @preferred_language = preferred_language - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - nick_name == o.nick_name && - display_name == o.display_name && - preferred_language == o.preferred_language && - gender == o.gender - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, nick_name, display_name, preferred_language, gender].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/organization_service_text_query_method.rb b/lib/zitadel/client/models/organization_service_text_query_method.rb deleted file mode 100644 index 5152fe17..00000000 --- a/lib/zitadel/client/models/organization_service_text_query_method.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OrganizationServiceTextQueryMethod - TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS".freeze - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH".freeze - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS".freeze - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH".freeze - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OrganizationServiceTextQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceTextQueryMethod" - end - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_post_response.rb b/lib/zitadel/client/models/otp.rb similarity index 89% rename from lib/zitadel/client/models/s_a_m_l_service_post_response.rb rename to lib/zitadel/client/models/otp.rb index 98881dd3..727c1df4 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_post_response.rb +++ b/lib/zitadel/client/models/otp.rb @@ -14,16 +14,13 @@ require 'time' module Zitadel::Client::Models - class SAMLServicePostResponse - attr_accessor :relay_state - - attr_accessor :saml_response + class Otp + attr_accessor :otp # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'relay_state' => :'relayState', - :'saml_response' => :'samlResponse' + :'otp' => :'otp' } end @@ -40,8 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'relay_state' => :'String', - :'saml_response' => :'String' + :'otp' => :'UserServiceAuthFactorOTP' } end @@ -56,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServicePostResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Otp` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServicePostResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Otp`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'relay_state') - self.relay_state = attributes[:'relay_state'] - end - - if attributes.key?(:'saml_response') - self.saml_response = attributes[:'saml_response'] + if attributes.key?(:'otp') + self.otp = attributes[:'otp'] + else + self.otp = nil end end @@ -83,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @otp.nil? + invalid_properties.push('invalid value for "otp", otp cannot be nil.') + end + invalid_properties end @@ -90,16 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @otp.nil? true end + # Custom attribute writer method with validation + # @param [UserServiceAuthFactorOTP] otp Value to be assigned + def otp=(otp) + if otp.nil? + fail ArgumentError, 'otp cannot be nil' + end + + @otp = otp + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - relay_state == o.relay_state && - saml_response == o.saml_response + otp == o.otp end # @see the `==` method @@ -111,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [relay_state, saml_response].hash + [otp].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/otp_email.rb b/lib/zitadel/client/models/otp_email.rb new file mode 100644 index 00000000..389f9fda --- /dev/null +++ b/lib/zitadel/client/models/otp_email.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class OtpEmail + attr_accessor :otp_email + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'otp_email' => :'otpEmail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'otp_email' => :'UserServiceAuthFactorOTPEmail' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OtpEmail` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OtpEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'otp_email') + self.otp_email = attributes[:'otp_email'] + else + self.otp_email = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @otp_email.nil? + invalid_properties.push('invalid value for "otp_email", otp_email cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @otp_email.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceAuthFactorOTPEmail] otp_email Value to be assigned + def otp_email=(otp_email) + if otp_email.nil? + fail ArgumentError, 'otp_email cannot be nil' + end + + @otp_email = otp_email + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + otp_email == o.otp_email + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [otp_email].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/otp_sms.rb b/lib/zitadel/client/models/otp_sms.rb new file mode 100644 index 00000000..b7f6898c --- /dev/null +++ b/lib/zitadel/client/models/otp_sms.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class OtpSms + attr_accessor :otp_sms + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'otp_sms' => :'otpSms' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'otp_sms' => :'UserServiceAuthFactorOTPSMS' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OtpSms` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OtpSms`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'otp_sms') + self.otp_sms = attributes[:'otp_sms'] + else + self.otp_sms = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @otp_sms.nil? + invalid_properties.push('invalid value for "otp_sms", otp_sms cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @otp_sms.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceAuthFactorOTPSMS] otp_sms Value to be assigned + def otp_sms=(otp_sms) + if otp_sms.nil? + fail ArgumentError, 'otp_sms cannot be nil' + end + + @otp_sms = otp_sms + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + otp_sms == o.otp_sms + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [otp_sms].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/password.rb b/lib/zitadel/client/models/password.rb new file mode 100644 index 00000000..52f06d70 --- /dev/null +++ b/lib/zitadel/client/models/password.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Password + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'password' => :'password' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'password' => :'UserServicePassword' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Password` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Password`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'password') + self.password = attributes[:'password'] + else + self.password = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @password.nil? + invalid_properties.push('invalid value for "password", password cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @password.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServicePassword] password Value to be assigned + def password=(password) + if password.nil? + fail ArgumentError, 'password cannot be nil' + end + + @password = password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [password].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/password1.rb b/lib/zitadel/client/models/password1.rb new file mode 100644 index 00000000..ee73d8b9 --- /dev/null +++ b/lib/zitadel/client/models/password1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Password1 + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'password' => :'password' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'password' => :'BetaUserServicePassword' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Password1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Password1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'password') + self.password = attributes[:'password'] + else + self.password = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @password.nil? + invalid_properties.push('invalid value for "password", password cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @password.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServicePassword] password Value to be assigned + def password=(password) + if password.nil? + fail ArgumentError, 'password cannot be nil' + end + + @password = password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [password].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/phone_query.rb b/lib/zitadel/client/models/phone_query.rb new file mode 100644 index 00000000..4770f17c --- /dev/null +++ b/lib/zitadel/client/models/phone_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class PhoneQuery + attr_accessor :phone_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'phone_query' => :'phoneQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'phone_query' => :'UserServicePhoneQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::PhoneQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::PhoneQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'phone_query') + self.phone_query = attributes[:'phone_query'] + else + self.phone_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @phone_query.nil? + invalid_properties.push('invalid value for "phone_query", phone_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @phone_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServicePhoneQuery] phone_query Value to be assigned + def phone_query=(phone_query) + if phone_query.nil? + fail ArgumentError, 'phone_query cannot be nil' + end + + @phone_query = phone_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + phone_query == o.phone_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [phone_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/phone_query1.rb b/lib/zitadel/client/models/phone_query1.rb new file mode 100644 index 00000000..a8673c78 --- /dev/null +++ b/lib/zitadel/client/models/phone_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class PhoneQuery1 + attr_accessor :phone_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'phone_query' => :'phoneQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'phone_query' => :'BetaUserServicePhoneQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::PhoneQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::PhoneQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'phone_query') + self.phone_query = attributes[:'phone_query'] + else + self.phone_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @phone_query.nil? + invalid_properties.push('invalid value for "phone_query", phone_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @phone_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServicePhoneQuery] phone_query Value to be assigned + def phone_query=(phone_query) + if phone_query.nil? + fail ArgumentError, 'phone_query cannot be nil' + end + + @phone_query = phone_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + phone_query == o.phone_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [phone_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/post.rb b/lib/zitadel/client/models/post.rb new file mode 100644 index 00000000..e2448c7b --- /dev/null +++ b/lib/zitadel/client/models/post.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Post + attr_accessor :post + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'post' => :'post' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'post' => :'SAMLServicePostResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Post` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Post`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'post') + self.post = attributes[:'post'] + else + self.post = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @post.nil? + invalid_properties.push('invalid value for "post", post cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @post.nil? + true + end + + # Custom attribute writer method with validation + # @param [SAMLServicePostResponse] post Value to be assigned + def post=(post) + if post.nil? + fail ArgumentError, 'post cannot be nil' + end + + @post = post + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + post == o.post + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [post].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/post_form.rb b/lib/zitadel/client/models/post_form.rb new file mode 100644 index 00000000..47a03723 --- /dev/null +++ b/lib/zitadel/client/models/post_form.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class PostForm + attr_accessor :post_form + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'post_form' => :'postForm' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'post_form' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::PostForm` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::PostForm`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'post_form') + self.post_form = attributes[:'post_form'] + else + self.post_form = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @post_form.nil? + invalid_properties.push('invalid value for "post_form", post_form cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @post_form.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] post_form Value to be assigned + def post_form=(post_form) + if post_form.nil? + fail ArgumentError, 'post_form cannot be nil' + end + + @post_form = post_form + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + post_form == o.post_form + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [post_form].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/redirect.rb b/lib/zitadel/client/models/redirect.rb new file mode 100644 index 00000000..5b8d4223 --- /dev/null +++ b/lib/zitadel/client/models/redirect.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Redirect + attr_accessor :redirect + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'redirect' => :'redirect' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'redirect' => :'SAMLServiceRedirectResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Redirect` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Redirect`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'redirect') + self.redirect = attributes[:'redirect'] + else + self.redirect = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @redirect.nil? + invalid_properties.push('invalid value for "redirect", redirect cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @redirect.nil? + true + end + + # Custom attribute writer method with validation + # @param [SAMLServiceRedirectResponse] redirect Value to be assigned + def redirect=(redirect) + if redirect.nil? + fail ArgumentError, 'redirect cannot be nil' + end + + @redirect = redirect + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + redirect == o.redirect + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [redirect].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/request.rb b/lib/zitadel/client/models/request.rb new file mode 100644 index 00000000..153e3331 --- /dev/null +++ b/lib/zitadel/client/models/request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Request + attr_accessor :request + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request' => :'request' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'request' => :'BetaActionServiceRequestExecution' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Request` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Request`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'request') + self.request = attributes[:'request'] + else + self.request = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @request.nil? + invalid_properties.push('invalid value for "request", request cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @request.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceRequestExecution] request Value to be assigned + def request=(request) + if request.nil? + fail ArgumentError, 'request cannot be nil' + end + + @request = request + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request == o.request + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/response.rb b/lib/zitadel/client/models/response.rb new file mode 100644 index 00000000..212a7bf2 --- /dev/null +++ b/lib/zitadel/client/models/response.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Response + attr_accessor :response + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'response' => :'response' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'response' => :'BetaActionServiceResponseExecution' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'response') + self.response = attributes[:'response'] + else + self.response = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @response.nil? + invalid_properties.push('invalid value for "response", response cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @response.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceResponseExecution] response Value to be assigned + def response=(response) + if response.nil? + fail ArgumentError, 'response cannot be nil' + end + + @response = response + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + response == o.response + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [response].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_and_query.rb b/lib/zitadel/client/models/rest_async.rb similarity index 87% rename from lib/zitadel/client/models/user_service_and_query.rb rename to lib/zitadel/client/models/rest_async.rb index 111d0bd0..e7aed631 100644 --- a/lib/zitadel/client/models/user_service_and_query.rb +++ b/lib/zitadel/client/models/rest_async.rb @@ -14,15 +14,13 @@ require 'time' module Zitadel::Client::Models - # Connect multiple sub-condition with and AND operator. - class UserServiceAndQuery - # the sub queries to 'AND' - attr_accessor :queries + class RestAsync + attr_accessor :rest_async # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'queries' => :'queries' + :'rest_async' => :'restAsync' } end @@ -39,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'queries' => :'Array' + :'rest_async' => :'BetaActionServiceRESTAsync' } end @@ -54,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAndQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::RestAsync` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -62,15 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAndQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::RestAsync`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end + if attributes.key?(:'rest_async') + self.rest_async = attributes[:'rest_async'] + else + self.rest_async = nil end end @@ -79,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @rest_async.nil? + invalid_properties.push('invalid value for "rest_async", rest_async cannot be nil.') + end + invalid_properties end @@ -86,15 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @rest_async.nil? true end + # Custom attribute writer method with validation + # @param [BetaActionServiceRESTAsync] rest_async Value to be assigned + def rest_async=(rest_async) + if rest_async.nil? + fail ArgumentError, 'rest_async cannot be nil' + end + + @rest_async = rest_async + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - queries == o.queries + rest_async == o.rest_async end # @see the `==` method @@ -106,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [queries].hash + [rest_async].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/rest_call.rb b/lib/zitadel/client/models/rest_call.rb new file mode 100644 index 00000000..e01ba98b --- /dev/null +++ b/lib/zitadel/client/models/rest_call.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class RestCall + attr_accessor :rest_call + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'rest_call' => :'restCall' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'rest_call' => :'BetaActionServiceRESTCall' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::RestCall` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::RestCall`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'rest_call') + self.rest_call = attributes[:'rest_call'] + else + self.rest_call = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @rest_call.nil? + invalid_properties.push('invalid value for "rest_call", rest_call cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @rest_call.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceRESTCall] rest_call Value to be assigned + def rest_call=(rest_call) + if rest_call.nil? + fail ArgumentError, 'rest_call cannot be nil' + end + + @rest_call = rest_call + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + rest_call == o.rest_call + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [rest_call].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/rest_webhook.rb b/lib/zitadel/client/models/rest_webhook.rb new file mode 100644 index 00000000..55c9e48c --- /dev/null +++ b/lib/zitadel/client/models/rest_webhook.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class RestWebhook + attr_accessor :rest_webhook + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'rest_webhook' => :'restWebhook' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'rest_webhook' => :'BetaActionServiceRESTWebhook' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::RestWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::RestWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'rest_webhook') + self.rest_webhook = attributes[:'rest_webhook'] + else + self.rest_webhook = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @rest_webhook.nil? + invalid_properties.push('invalid value for "rest_webhook", rest_webhook cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @rest_webhook.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceRESTWebhook] rest_webhook Value to be assigned + def rest_webhook=(rest_webhook) + if rest_webhook.nil? + fail ArgumentError, 'rest_webhook cannot be nil' + end + + @rest_webhook = rest_webhook + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + rest_webhook == o.rest_webhook + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [rest_webhook].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code.rb b/lib/zitadel/client/models/return_code.rb new file mode 100644 index 00000000..56f7013e --- /dev/null +++ b/lib/zitadel/client/models/return_code.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'BetaSessionServiceReturnCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaSessionServiceReturnCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_request_challenges_o_t_p_email.rb b/lib/zitadel/client/models/return_code1.rb similarity index 89% rename from lib/zitadel/client/models/session_service_request_challenges_o_t_p_email.rb rename to lib/zitadel/client/models/return_code1.rb index 4fddc4e2..31ee9e3c 100644 --- a/lib/zitadel/client/models/session_service_request_challenges_o_t_p_email.rb +++ b/lib/zitadel/client/models/return_code1.rb @@ -14,15 +14,12 @@ require 'time' module Zitadel::Client::Models - class SessionServiceRequestChallengesOTPEmail - attr_accessor :send_code - + class ReturnCode1 attr_accessor :return_code # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'send_code' => :'sendCode', :'return_code' => :'returnCode' } end @@ -40,8 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'send_code' => :'SessionServiceOTPEmailSendCode', - :'return_code' => :'Object' + :'return_code' => :'SessionServiceReturnCode' } end @@ -56,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceRequestChallengesOTPEmail` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode1` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceRequestChallengesOTPEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - if attributes.key?(:'return_code') self.return_code = attributes[:'return_code'] + else + self.return_code = nil end end @@ -83,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + invalid_properties end @@ -90,15 +88,25 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? true end + # Custom attribute writer method with validation + # @param [SessionServiceReturnCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - send_code == o.send_code && return_code == o.return_code end @@ -111,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [send_code, return_code].hash + [return_code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/return_code10.rb b/lib/zitadel/client/models/return_code10.rb new file mode 100644 index 00000000..2b7e78c6 --- /dev/null +++ b/lib/zitadel/client/models/return_code10.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode10 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'BetaUserServiceReturnPasswordResetCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode10` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode10`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceReturnPasswordResetCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code2.rb b/lib/zitadel/client/models/return_code2.rb new file mode 100644 index 00000000..1f0b4346 --- /dev/null +++ b/lib/zitadel/client/models/return_code2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode2 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'UserServiceReturnEmailVerificationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceReturnEmailVerificationCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code3.rb b/lib/zitadel/client/models/return_code3.rb new file mode 100644 index 00000000..0fadc87e --- /dev/null +++ b/lib/zitadel/client/models/return_code3.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode3 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'UserServiceReturnPhoneVerificationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceReturnPhoneVerificationCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code4.rb b/lib/zitadel/client/models/return_code4.rb new file mode 100644 index 00000000..048b9e0c --- /dev/null +++ b/lib/zitadel/client/models/return_code4.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode4 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'UserServiceReturnPasskeyRegistrationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode4` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode4`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceReturnPasskeyRegistrationCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code5.rb b/lib/zitadel/client/models/return_code5.rb new file mode 100644 index 00000000..b2d6d688 --- /dev/null +++ b/lib/zitadel/client/models/return_code5.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode5 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'UserServiceReturnPasswordResetCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode5` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode5`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceReturnPasswordResetCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code6.rb b/lib/zitadel/client/models/return_code6.rb new file mode 100644 index 00000000..f02fd2e3 --- /dev/null +++ b/lib/zitadel/client/models/return_code6.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode6 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'UserServiceReturnInviteCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode6` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode6`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceReturnInviteCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code7.rb b/lib/zitadel/client/models/return_code7.rb new file mode 100644 index 00000000..583b379a --- /dev/null +++ b/lib/zitadel/client/models/return_code7.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode7 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'BetaUserServiceReturnEmailVerificationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode7` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode7`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceReturnEmailVerificationCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code8.rb b/lib/zitadel/client/models/return_code8.rb new file mode 100644 index 00000000..40071017 --- /dev/null +++ b/lib/zitadel/client/models/return_code8.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode8 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'BetaUserServiceReturnPhoneVerificationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode8` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode8`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceReturnPhoneVerificationCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/return_code9.rb b/lib/zitadel/client/models/return_code9.rb new file mode 100644 index 00000000..1545a4b5 --- /dev/null +++ b/lib/zitadel/client/models/return_code9.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ReturnCode9 + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'BetaUserServiceReturnPasskeyRegistrationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ReturnCode9` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ReturnCode9`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + else + self.return_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @return_code.nil? + invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @return_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceReturnPasskeyRegistrationCode] return_code Value to be assigned + def return_code=(return_code) + if return_code.nil? + fail ArgumentError, 'return_code cannot be nil' + end + + @return_code = return_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/rsa.rb b/lib/zitadel/client/models/rsa.rb new file mode 100644 index 00000000..a2d687da --- /dev/null +++ b/lib/zitadel/client/models/rsa.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Rsa + attr_accessor :rsa + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'rsa' => :'rsa' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'rsa' => :'BetaWebKeyServiceRSA' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Rsa` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Rsa`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'rsa') + self.rsa = attributes[:'rsa'] + else + self.rsa = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @rsa.nil? + invalid_properties.push('invalid value for "rsa", rsa cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @rsa.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaWebKeyServiceRSA] rsa Value to be assigned + def rsa=(rsa) + if rsa.nil? + fail ArgumentError, 'rsa cannot be nil' + end + + @rsa = rsa + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + rsa == o.rsa + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [rsa].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/s_a_m_l_service_any.rb b/lib/zitadel/client/models/s_a_m_l_service_any.rb new file mode 100644 index 00000000..eaec809a --- /dev/null +++ b/lib/zitadel/client/models/s_a_m_l_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class SAMLServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/s_a_m_l_service_connect_error.rb b/lib/zitadel/client/models/s_a_m_l_service_connect_error.rb new file mode 100644 index 00000000..33246eea --- /dev/null +++ b/lib/zitadel/client/models/s_a_m_l_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class SAMLServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'SAMLServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/s_a_m_l_service_details.rb b/lib/zitadel/client/models/s_a_m_l_service_details.rb index abc08358..d519fc09 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_details.rb +++ b/lib/zitadel/client/models/s_a_m_l_service_details.rb @@ -15,14 +15,16 @@ module Zitadel::Client::Models class SAMLServiceDetails - # on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation attr_accessor :sequence - # on read: the timestamp of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date + # resource_owner is the organization or instance_id an object belongs to attr_accessor :resource_owner + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date # Attribute mapping from ruby-style variable name to JSON key. @@ -48,7 +50,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'sequence' => :'String', + :'sequence' => :'Object', :'change_date' => :'Time', :'resource_owner' => :'String', :'creation_date' => :'Time' @@ -58,6 +60,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/s_a_m_l_service_error_reason.rb b/lib/zitadel/client/models/s_a_m_l_service_error_reason.rb deleted file mode 100644 index 67d3c02e..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_error_reason.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceErrorReason - ERROR_REASON_UNSPECIFIED = "ERROR_REASON_UNSPECIFIED".freeze - ERROR_REASON_VERSION_MISSMATCH = "ERROR_REASON_VERSION_MISSMATCH".freeze - ERROR_REASON_AUTH_N_FAILED = "ERROR_REASON_AUTH_N_FAILED".freeze - ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE = "ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE".freeze - ERROR_REASON_INVALID_NAMEID_POLICY = "ERROR_REASON_INVALID_NAMEID_POLICY".freeze - ERROR_REASON_REQUEST_DENIED = "ERROR_REASON_REQUEST_DENIED".freeze - ERROR_REASON_REQUEST_UNSUPPORTED = "ERROR_REASON_REQUEST_UNSUPPORTED".freeze - ERROR_REASON_UNSUPPORTED_BINDING = "ERROR_REASON_UNSUPPORTED_BINDING".freeze - - def self.all_vars - @all_vars ||= [ERROR_REASON_UNSPECIFIED, ERROR_REASON_VERSION_MISSMATCH, ERROR_REASON_AUTH_N_FAILED, ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE, ERROR_REASON_INVALID_NAMEID_POLICY, ERROR_REASON_REQUEST_DENIED, ERROR_REASON_REQUEST_UNSUPPORTED, ERROR_REASON_UNSUPPORTED_BINDING].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SAMLServiceErrorReason.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SAMLServiceErrorReason" - end - end - -end diff --git a/lib/zitadel/client/models/user_service_auth_factor_u2_f.rb b/lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_request.rb similarity index 90% rename from lib/zitadel/client/models/user_service_auth_factor_u2_f.rb rename to lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_request.rb index fa1048a6..a53933f0 100644 --- a/lib/zitadel/client/models/user_service_auth_factor_u2_f.rb +++ b/lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_request.rb @@ -14,16 +14,14 @@ require 'time' module Zitadel::Client::Models - class UserServiceAuthFactorU2F - attr_accessor :id - - attr_accessor :name + class SAMLServiceGetSAMLRequestRequest + # ID of the SAML Request, as obtained from the redirect URL. + attr_accessor :saml_request_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - :'name' => :'name' + :'saml_request_id' => :'samlRequestId' } end @@ -40,8 +38,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - :'name' => :'String' + :'saml_request_id' => :'String' } end @@ -56,7 +53,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAuthFactorU2F` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceGetSAMLRequestRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -64,17 +61,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAuthFactorU2F`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceGetSAMLRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] + if attributes.key?(:'saml_request_id') + self.saml_request_id = attributes[:'saml_request_id'] end end @@ -98,8 +91,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - id == o.id && - name == o.name + saml_request_id == o.saml_request_id end # @see the `==` method @@ -111,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name].hash + [saml_request_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/s_a_m_l_service_s_a_m_l_request.rb b/lib/zitadel/client/models/s_a_m_l_service_s_a_m_l_request.rb index 58482625..7bed540e 100644 --- a/lib/zitadel/client/models/s_a_m_l_service_s_a_m_l_request.rb +++ b/lib/zitadel/client/models/s_a_m_l_service_s_a_m_l_request.rb @@ -15,22 +15,17 @@ module Zitadel::Client::Models class SAMLServiceSAMLRequest - # ID of the SAMLRequest attr_accessor :id - # Time when the SAMLRequest was created + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date - # SAML entityID of the application that created the SAMLRequest attr_accessor :issuer - # URL which points back to the assertion consumer service of the application attr_accessor :assertion_consumer_service - # RelayState provided by the application for the request attr_accessor :relay_state - # Binding used by the application for the request attr_accessor :binding # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/saml.rb b/lib/zitadel/client/models/saml.rb new file mode 100644 index 00000000..07716e11 --- /dev/null +++ b/lib/zitadel/client/models/saml.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Saml + attr_accessor :saml + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'saml' => :'saml' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'saml' => :'IdentityProviderServiceSAMLConfig' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Saml` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Saml`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'saml') + self.saml = attributes[:'saml'] + else + self.saml = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @saml.nil? + invalid_properties.push('invalid value for "saml", saml cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @saml.nil? + true + end + + # Custom attribute writer method with validation + # @param [IdentityProviderServiceSAMLConfig] saml Value to be assigned + def saml=(saml) + if saml.nil? + fail ArgumentError, 'saml cannot be nil' + end + + @saml = saml + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + saml == o.saml + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [saml].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/saml1.rb b/lib/zitadel/client/models/saml1.rb new file mode 100644 index 00000000..fc0ef8d1 --- /dev/null +++ b/lib/zitadel/client/models/saml1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Saml1 + attr_accessor :saml + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'saml' => :'saml' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'saml' => :'UserServiceIDPSAMLAccessInformation' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Saml1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Saml1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'saml') + self.saml = attributes[:'saml'] + else + self.saml = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @saml.nil? + invalid_properties.push('invalid value for "saml", saml cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @saml.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceIDPSAMLAccessInformation] saml Value to be assigned + def saml=(saml) + if saml.nil? + fail ArgumentError, 'saml cannot be nil' + end + + @saml = saml + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + saml == o.saml + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [saml].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/saml2.rb b/lib/zitadel/client/models/saml2.rb new file mode 100644 index 00000000..8b90244f --- /dev/null +++ b/lib/zitadel/client/models/saml2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Saml2 + attr_accessor :saml + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'saml' => :'saml' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'saml' => :'BetaUserServiceIDPSAMLAccessInformation' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Saml2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Saml2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'saml') + self.saml = attributes[:'saml'] + else + self.saml = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @saml.nil? + invalid_properties.push('invalid value for "saml", saml cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @saml.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceIDPSAMLAccessInformation] saml Value to be assigned + def saml=(saml) + if saml.nil? + fail ArgumentError, 'saml cannot be nil' + end + + @saml = saml + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + saml == o.saml + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [saml].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/saml_service_create_response_request.rb b/lib/zitadel/client/models/saml_service_create_response_request.rb new file mode 100644 index 00000000..683c74a1 --- /dev/null +++ b/lib/zitadel/client/models/saml_service_create_response_request.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module SAMLServiceCreateResponseRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Error1', + :'Session1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/saml_service_create_response_response.rb b/lib/zitadel/client/models/saml_service_create_response_response.rb new file mode 100644 index 00000000..13e34151 --- /dev/null +++ b/lib/zitadel/client/models/saml_service_create_response_response.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module SAMLServiceCreateResponseResponse + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Post', + :'Redirect' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/send_code.rb b/lib/zitadel/client/models/send_code.rb new file mode 100644 index 00000000..bf619eeb --- /dev/null +++ b/lib/zitadel/client/models/send_code.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendCode + attr_accessor :send_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_code' => :'sendCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_code' => :'BetaSessionServiceSendCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendCode` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_code') + self.send_code = attributes[:'send_code'] + else + self.send_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_code.nil? + invalid_properties.push('invalid value for "send_code", send_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaSessionServiceSendCode] send_code Value to be assigned + def send_code=(send_code) + if send_code.nil? + fail ArgumentError, 'send_code cannot be nil' + end + + @send_code = send_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_code == o.send_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_code1.rb b/lib/zitadel/client/models/send_code1.rb new file mode 100644 index 00000000..b75bd8bf --- /dev/null +++ b/lib/zitadel/client/models/send_code1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendCode1 + attr_accessor :send_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_code' => :'sendCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_code' => :'SessionServiceSendCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendCode1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendCode1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_code') + self.send_code = attributes[:'send_code'] + else + self.send_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_code.nil? + invalid_properties.push('invalid value for "send_code", send_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [SessionServiceSendCode] send_code Value to be assigned + def send_code=(send_code) + if send_code.nil? + fail ArgumentError, 'send_code cannot be nil' + end + + @send_code = send_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_code == o.send_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_code2.rb b/lib/zitadel/client/models/send_code2.rb new file mode 100644 index 00000000..a0049133 --- /dev/null +++ b/lib/zitadel/client/models/send_code2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendCode2 + attr_accessor :send_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_code' => :'sendCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_code' => :'UserServiceSendEmailVerificationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendCode2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendCode2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_code') + self.send_code = attributes[:'send_code'] + else + self.send_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_code.nil? + invalid_properties.push('invalid value for "send_code", send_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceSendEmailVerificationCode] send_code Value to be assigned + def send_code=(send_code) + if send_code.nil? + fail ArgumentError, 'send_code cannot be nil' + end + + @send_code = send_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_code == o.send_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_code3.rb b/lib/zitadel/client/models/send_code3.rb new file mode 100644 index 00000000..628115ae --- /dev/null +++ b/lib/zitadel/client/models/send_code3.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendCode3 + attr_accessor :send_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_code' => :'sendCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_code' => :'UserServiceSendPhoneVerificationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendCode3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendCode3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_code') + self.send_code = attributes[:'send_code'] + else + self.send_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_code.nil? + invalid_properties.push('invalid value for "send_code", send_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceSendPhoneVerificationCode] send_code Value to be assigned + def send_code=(send_code) + if send_code.nil? + fail ArgumentError, 'send_code cannot be nil' + end + + @send_code = send_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_code == o.send_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_code4.rb b/lib/zitadel/client/models/send_code4.rb new file mode 100644 index 00000000..7bf673ce --- /dev/null +++ b/lib/zitadel/client/models/send_code4.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendCode4 + attr_accessor :send_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_code' => :'sendCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_code' => :'UserServiceSendInviteCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendCode4` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendCode4`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_code') + self.send_code = attributes[:'send_code'] + else + self.send_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_code.nil? + invalid_properties.push('invalid value for "send_code", send_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceSendInviteCode] send_code Value to be assigned + def send_code=(send_code) + if send_code.nil? + fail ArgumentError, 'send_code cannot be nil' + end + + @send_code = send_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_code == o.send_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_code5.rb b/lib/zitadel/client/models/send_code5.rb new file mode 100644 index 00000000..42630ac2 --- /dev/null +++ b/lib/zitadel/client/models/send_code5.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendCode5 + attr_accessor :send_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_code' => :'sendCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_code' => :'BetaUserServiceSendEmailVerificationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendCode5` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendCode5`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_code') + self.send_code = attributes[:'send_code'] + else + self.send_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_code.nil? + invalid_properties.push('invalid value for "send_code", send_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceSendEmailVerificationCode] send_code Value to be assigned + def send_code=(send_code) + if send_code.nil? + fail ArgumentError, 'send_code cannot be nil' + end + + @send_code = send_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_code == o.send_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_code6.rb b/lib/zitadel/client/models/send_code6.rb new file mode 100644 index 00000000..8bab0c48 --- /dev/null +++ b/lib/zitadel/client/models/send_code6.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendCode6 + attr_accessor :send_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_code' => :'sendCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_code' => :'BetaUserServiceSendPhoneVerificationCode' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendCode6` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendCode6`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_code') + self.send_code = attributes[:'send_code'] + else + self.send_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_code.nil? + invalid_properties.push('invalid value for "send_code", send_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceSendPhoneVerificationCode] send_code Value to be assigned + def send_code=(send_code) + if send_code.nil? + fail ArgumentError, 'send_code cannot be nil' + end + + @send_code = send_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_code == o.send_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_link.rb b/lib/zitadel/client/models/send_link.rb new file mode 100644 index 00000000..3eaca1c1 --- /dev/null +++ b/lib/zitadel/client/models/send_link.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendLink + attr_accessor :send_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_link' => :'sendLink' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_link' => :'UserServiceSendPasskeyRegistrationLink' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendLink` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_link') + self.send_link = attributes[:'send_link'] + else + self.send_link = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_link.nil? + invalid_properties.push('invalid value for "send_link", send_link cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_link.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceSendPasskeyRegistrationLink] send_link Value to be assigned + def send_link=(send_link) + if send_link.nil? + fail ArgumentError, 'send_link cannot be nil' + end + + @send_link = send_link + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_link == o.send_link + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_link].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_link1.rb b/lib/zitadel/client/models/send_link1.rb new file mode 100644 index 00000000..8a37d84b --- /dev/null +++ b/lib/zitadel/client/models/send_link1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendLink1 + attr_accessor :send_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_link' => :'sendLink' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_link' => :'UserServiceSendPasswordResetLink' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendLink1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendLink1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_link') + self.send_link = attributes[:'send_link'] + else + self.send_link = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_link.nil? + invalid_properties.push('invalid value for "send_link", send_link cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_link.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceSendPasswordResetLink] send_link Value to be assigned + def send_link=(send_link) + if send_link.nil? + fail ArgumentError, 'send_link cannot be nil' + end + + @send_link = send_link + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_link == o.send_link + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_link].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_link2.rb b/lib/zitadel/client/models/send_link2.rb new file mode 100644 index 00000000..1c97292a --- /dev/null +++ b/lib/zitadel/client/models/send_link2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendLink2 + attr_accessor :send_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_link' => :'sendLink' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_link' => :'BetaUserServiceSendPasskeyRegistrationLink' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendLink2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendLink2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_link') + self.send_link = attributes[:'send_link'] + else + self.send_link = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_link.nil? + invalid_properties.push('invalid value for "send_link", send_link cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_link.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceSendPasskeyRegistrationLink] send_link Value to be assigned + def send_link=(send_link) + if send_link.nil? + fail ArgumentError, 'send_link cannot be nil' + end + + @send_link = send_link + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_link == o.send_link + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_link].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/send_link3.rb b/lib/zitadel/client/models/send_link3.rb new file mode 100644 index 00000000..4a289dea --- /dev/null +++ b/lib/zitadel/client/models/send_link3.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SendLink3 + attr_accessor :send_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'send_link' => :'sendLink' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'send_link' => :'BetaUserServiceSendPasswordResetLink' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SendLink3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SendLink3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'send_link') + self.send_link = attributes[:'send_link'] + else + self.send_link = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @send_link.nil? + invalid_properties.push('invalid value for "send_link", send_link cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @send_link.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceSendPasswordResetLink] send_link Value to be assigned + def send_link=(send_link) + if send_link.nil? + fail ArgumentError, 'send_link cannot be nil' + end + + @send_link = send_link + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + send_link == o.send_link + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [send_link].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session.rb b/lib/zitadel/client/models/session.rb new file mode 100644 index 00000000..aaf229ce --- /dev/null +++ b/lib/zitadel/client/models/session.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Session + attr_accessor :session + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session' => :'session' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'session' => :'OIDCServiceSession' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Session` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Session`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session') + self.session = attributes[:'session'] + else + self.session = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @session.nil? + invalid_properties.push('invalid value for "session", session cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @session.nil? + true + end + + # Custom attribute writer method with validation + # @param [OIDCServiceSession] session Value to be assigned + def session=(session) + if session.nil? + fail ArgumentError, 'session cannot be nil' + end + + @session = session + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session == o.session + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session1.rb b/lib/zitadel/client/models/session1.rb new file mode 100644 index 00000000..9a31bff9 --- /dev/null +++ b/lib/zitadel/client/models/session1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Session1 + attr_accessor :session + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session' => :'session' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'session' => :'SAMLServiceSession' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Session1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Session1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session') + self.session = attributes[:'session'] + else + self.session = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @session.nil? + invalid_properties.push('invalid value for "session", session cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @session.nil? + true + end + + # Custom attribute writer method with validation + # @param [SAMLServiceSession] session Value to be assigned + def session=(session) + if session.nil? + fail ArgumentError, 'session cannot be nil' + end + + @session = session + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session == o.session + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session2.rb b/lib/zitadel/client/models/session2.rb new file mode 100644 index 00000000..5ed92b8c --- /dev/null +++ b/lib/zitadel/client/models/session2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Session2 + attr_accessor :session + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session' => :'session' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'session' => :'BetaOIDCServiceSession' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Session2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Session2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session') + self.session = attributes[:'session'] + else + self.session = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @session.nil? + invalid_properties.push('invalid value for "session", session cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @session.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaOIDCServiceSession] session Value to be assigned + def session=(session) + if session.nil? + fail ArgumentError, 'session cannot be nil' + end + + @session = session + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session == o.session + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_any.rb b/lib/zitadel/client/models/session_service_any.rb new file mode 100644 index 00000000..6139c1e5 --- /dev/null +++ b/lib/zitadel/client/models/session_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class SessionServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_challenges.rb b/lib/zitadel/client/models/session_service_challenges.rb index 698085ff..8717a6d9 100644 --- a/lib/zitadel/client/models/session_service_challenges.rb +++ b/lib/zitadel/client/models/session_service_challenges.rb @@ -43,7 +43,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'web_auth_n' => :'SessionServiceChallengesWebAuthN', + :'web_auth_n' => :'SessionServiceWebAuthN', :'otp_sms' => :'String', :'otp_email' => :'String' } @@ -52,6 +52,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'otp_sms', + :'otp_email' ]) end diff --git a/lib/zitadel/client/models/session_service_challenges_web_auth_n.rb b/lib/zitadel/client/models/session_service_challenges_web_auth_n.rb deleted file mode 100644 index 993d463d..00000000 --- a/lib/zitadel/client/models/session_service_challenges_web_auth_n.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceChallengesWebAuthN - # Options for Assertion Generaration (dictionary PublicKeyCredentialRequestOptions). Generated helper methods transform the field to JSON, for use in a WebauthN client. See also: https://www.w3.org/TR/webauthn/#dictdef-publickeycredentialrequestoptions - attr_accessor :public_key_credential_request_options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'public_key_credential_request_options' => :'publicKeyCredentialRequestOptions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'public_key_credential_request_options' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceChallengesWebAuthN` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceChallengesWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'public_key_credential_request_options') - self.public_key_credential_request_options = attributes[:'public_key_credential_request_options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - public_key_credential_request_options == o.public_key_credential_request_options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [public_key_credential_request_options].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_check_i_d_p_intent.rb b/lib/zitadel/client/models/session_service_check_i_d_p_intent.rb index a9cde4b0..e7af7efd 100644 --- a/lib/zitadel/client/models/session_service_check_i_d_p_intent.rb +++ b/lib/zitadel/client/models/session_service_check_i_d_p_intent.rb @@ -15,10 +15,8 @@ module Zitadel::Client::Models class SessionServiceCheckIDPIntent - # ID of the idp intent, previously returned on the success response of the IDP callback attr_accessor :idp_intent_id - # token of the idp intent, previously returned on the success response of the IDP callback attr_accessor :idp_intent_token # Attribute mapping from ruby-style variable name to JSON key. @@ -85,22 +83,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@idp_intent_id.nil? && @idp_intent_id.to_s.length > 200 - invalid_properties.push('invalid value for "idp_intent_id", the character length must be smaller than or equal to 200.') - end - - if !@idp_intent_id.nil? && @idp_intent_id.to_s.length < 1 - invalid_properties.push('invalid value for "idp_intent_id", the character length must be great than or equal to 1.') - end - - if !@idp_intent_token.nil? && @idp_intent_token.to_s.length > 200 - invalid_properties.push('invalid value for "idp_intent_token", the character length must be smaller than or equal to 200.') - end - - if !@idp_intent_token.nil? && @idp_intent_token.to_s.length < 1 - invalid_properties.push('invalid value for "idp_intent_token", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -108,49 +90,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@idp_intent_id.nil? && @idp_intent_id.to_s.length > 200 - return false if !@idp_intent_id.nil? && @idp_intent_id.to_s.length < 1 - return false if !@idp_intent_token.nil? && @idp_intent_token.to_s.length > 200 - return false if !@idp_intent_token.nil? && @idp_intent_token.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] idp_intent_id Value to be assigned - def idp_intent_id=(idp_intent_id) - if idp_intent_id.nil? - fail ArgumentError, 'idp_intent_id cannot be nil' - end - - if idp_intent_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "idp_intent_id", the character length must be smaller than or equal to 200.' - end - - if idp_intent_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "idp_intent_id", the character length must be great than or equal to 1.' - end - - @idp_intent_id = idp_intent_id - end - - # Custom attribute writer method with validation - # @param [Object] idp_intent_token Value to be assigned - def idp_intent_token=(idp_intent_token) - if idp_intent_token.nil? - fail ArgumentError, 'idp_intent_token cannot be nil' - end - - if idp_intent_token.to_s.length > 200 - fail ArgumentError, 'invalid value for "idp_intent_token", the character length must be smaller than or equal to 200.' - end - - if idp_intent_token.to_s.length < 1 - fail ArgumentError, 'invalid value for "idp_intent_token", the character length must be great than or equal to 1.' - end - - @idp_intent_token = idp_intent_token - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/session_service_check_o_t_p.rb b/lib/zitadel/client/models/session_service_check_o_t_p.rb index 27e0cb01..0aa725b7 100644 --- a/lib/zitadel/client/models/session_service_check_o_t_p.rb +++ b/lib/zitadel/client/models/session_service_check_o_t_p.rb @@ -75,10 +75,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@code.nil? && @code.to_s.length < 1 - invalid_properties.push('invalid value for "code", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -86,24 +82,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@code.nil? && @code.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] code Value to be assigned - def code=(code) - if code.nil? - fail ArgumentError, 'code cannot be nil' - end - - if code.to_s.length < 1 - fail ArgumentError, 'invalid value for "code", the character length must be great than or equal to 1.' - end - - @code = code - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/session_service_check_password.rb b/lib/zitadel/client/models/session_service_check_password.rb index c815ab40..fed3c1a4 100644 --- a/lib/zitadel/client/models/session_service_check_password.rb +++ b/lib/zitadel/client/models/session_service_check_password.rb @@ -75,14 +75,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@password.nil? && @password.to_s.length > 200 - invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 200.') - end - - if !@password.nil? && @password.to_s.length < 1 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -90,29 +82,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@password.nil? && @password.to_s.length > 200 - return false if !@password.nil? && @password.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] password Value to be assigned - def password=(password) - if password.nil? - fail ArgumentError, 'password cannot be nil' - end - - if password.to_s.length > 200 - fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 200.' - end - - if password.to_s.length < 1 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.' - end - - @password = password - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/session_service_check_t_o_t_p.rb b/lib/zitadel/client/models/session_service_check_t_o_t_p.rb index aef73e2d..9b19783f 100644 --- a/lib/zitadel/client/models/session_service_check_t_o_t_p.rb +++ b/lib/zitadel/client/models/session_service_check_t_o_t_p.rb @@ -75,14 +75,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@code.nil? && @code.to_s.length > 6 - invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 6.') - end - - if !@code.nil? && @code.to_s.length < 6 - invalid_properties.push('invalid value for "code", the character length must be great than or equal to 6.') - end - invalid_properties end @@ -90,29 +82,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@code.nil? && @code.to_s.length > 6 - return false if !@code.nil? && @code.to_s.length < 6 true end - # Custom attribute writer method with validation - # @param [Object] code Value to be assigned - def code=(code) - if code.nil? - fail ArgumentError, 'code cannot be nil' - end - - if code.to_s.length > 6 - fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 6.' - end - - if code.to_s.length < 6 - fail ArgumentError, 'invalid value for "code", the character length must be great than or equal to 6.' - end - - @code = code - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/session_service_check_user.rb b/lib/zitadel/client/models/session_service_check_user.rb index 9f275195..5a6b300d 100644 --- a/lib/zitadel/client/models/session_service_check_user.rb +++ b/lib/zitadel/client/models/session_service_check_user.rb @@ -14,282 +14,97 @@ require 'time' module Zitadel::Client::Models - class SessionServiceCheckUser - attr_accessor :user_id - - attr_accessor :login_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'login_name' => :'loginName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'login_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCheckUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCheckUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module SessionServiceCheckUser + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LoginName', + :'UserId' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@user_id.nil? && @user_id.to_s.length > 200 - invalid_properties.push('invalid value for "user_id", the character length must be smaller than or equal to 200.') - end - - if !@user_id.nil? && @user_id.to_s.length < 1 - invalid_properties.push('invalid value for "user_id", the character length must be great than or equal to 1.') - end - - if !@login_name.nil? && @login_name.to_s.length > 200 - invalid_properties.push('invalid value for "login_name", the character length must be smaller than or equal to 200.') - end - - if !@login_name.nil? && @login_name.to_s.length < 1 - invalid_properties.push('invalid value for "login_name", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@user_id.nil? && @user_id.to_s.length > 200 - return false if !@user_id.nil? && @user_id.to_s.length < 1 - return false if !@login_name.nil? && @login_name.to_s.length > 200 - return false if !@login_name.nil? && @login_name.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] user_id Value to be assigned - def user_id=(user_id) - if user_id.nil? - fail ArgumentError, 'user_id cannot be nil' - end - - if user_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_id", the character length must be smaller than or equal to 200.' - end - - if user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "user_id", the character length must be great than or equal to 1.' - end - - @user_id = user_id - end - - # Custom attribute writer method with validation - # @param [Object] login_name Value to be assigned - def login_name=(login_name) - if login_name.nil? - fail ArgumentError, 'login_name cannot be nil' - end - - if login_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "login_name", the character length must be smaller than or equal to 200.' - end - - if login_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "login_name", the character length must be great than or equal to 1.' end - @login_name = login_name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - login_name == o.login_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, login_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_check_web_auth_n.rb b/lib/zitadel/client/models/session_service_check_web_auth_n.rb index 0a786577..3fa65b73 100644 --- a/lib/zitadel/client/models/session_service_check_web_auth_n.rb +++ b/lib/zitadel/client/models/session_service_check_web_auth_n.rb @@ -15,7 +15,7 @@ module Zitadel::Client::Models class SessionServiceCheckWebAuthN - # JSON representation of public key credential issued by the webAuthN client + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. attr_accessor :credential_assertion_data # Attribute mapping from ruby-style variable name to JSON key. @@ -38,7 +38,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'credential_assertion_data' => :'Object' + :'credential_assertion_data' => :'Hash' } end @@ -67,7 +67,9 @@ def initialize(attributes = {}) } if attributes.key?(:'credential_assertion_data') - self.credential_assertion_data = attributes[:'credential_assertion_data'] + if (value = attributes[:'credential_assertion_data']).is_a?(Hash) + self.credential_assertion_data = value + end else self.credential_assertion_data = nil end @@ -94,7 +96,7 @@ def valid? end # Custom attribute writer method with validation - # @param [Object] credential_assertion_data Value to be assigned + # @param [Hash] credential_assertion_data Value to be assigned def credential_assertion_data=(credential_assertion_data) if credential_assertion_data.nil? fail ArgumentError, 'credential_assertion_data cannot be nil' diff --git a/lib/zitadel/client/models/session_service_connect_error.rb b/lib/zitadel/client/models/session_service_connect_error.rb new file mode 100644 index 00000000..e0b99b47 --- /dev/null +++ b/lib/zitadel/client/models/session_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class SessionServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'SessionServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_create_session_request.rb b/lib/zitadel/client/models/session_service_create_session_request.rb index caa4d95e..dc67294b 100644 --- a/lib/zitadel/client/models/session_service_create_session_request.rb +++ b/lib/zitadel/client/models/session_service_create_session_request.rb @@ -17,14 +17,13 @@ module Zitadel::Client::Models class SessionServiceCreateSessionRequest attr_accessor :checks - # \"custom key value list to be stored on the session\" attr_accessor :metadata attr_accessor :challenges attr_accessor :user_agent - # \"duration (in seconds) after which the session will be automatically invalidated\" + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". attr_accessor :lifetime # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/session_service_create_session_response.rb b/lib/zitadel/client/models/session_service_create_session_response.rb index 08b5cdc3..314de2e8 100644 --- a/lib/zitadel/client/models/session_service_create_session_response.rb +++ b/lib/zitadel/client/models/session_service_create_session_response.rb @@ -17,10 +17,8 @@ module Zitadel::Client::Models class SessionServiceCreateSessionResponse attr_accessor :details - # \"id of the session\" attr_accessor :session_id - # \"The current token of the session, which is required for delete session, get session or the request of other resources.\" attr_accessor :session_token attr_accessor :challenges diff --git a/lib/zitadel/client/models/session_service_delete_session_request.rb b/lib/zitadel/client/models/session_service_delete_session_request.rb index 7bb5d5d7..d90b4733 100644 --- a/lib/zitadel/client/models/session_service_delete_session_request.rb +++ b/lib/zitadel/client/models/session_service_delete_session_request.rb @@ -15,12 +15,14 @@ module Zitadel::Client::Models class SessionServiceDeleteSessionRequest - # \"The current token of the session, previously returned on the create / update request. The token is required unless the authenticated user terminates the own session or is granted the `session.delete` permission.\" + attr_accessor :session_id + attr_accessor :session_token # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'session_id' => :'sessionId', :'session_token' => :'sessionToken' } end @@ -38,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'session_id' => :'String', :'session_token' => :'String' } end @@ -45,6 +48,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'session_token' ]) end @@ -66,6 +70,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'session_id') + self.session_id = attributes[:'session_id'] + end + if attributes.key?(:'session_token') self.session_token = attributes[:'session_token'] end @@ -91,6 +99,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + session_id == o.session_id && session_token == o.session_token end @@ -103,7 +112,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [session_token].hash + [session_id, session_token].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/session_service_details.rb b/lib/zitadel/client/models/session_service_details.rb index bdc7f55b..97b09d68 100644 --- a/lib/zitadel/client/models/session_service_details.rb +++ b/lib/zitadel/client/models/session_service_details.rb @@ -15,14 +15,16 @@ module Zitadel::Client::Models class SessionServiceDetails - # on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation attr_accessor :sequence - # on read: the timestamp of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date + # resource_owner is the organization or instance_id an object belongs to attr_accessor :resource_owner + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date # Attribute mapping from ruby-style variable name to JSON key. @@ -48,7 +50,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'sequence' => :'String', + :'sequence' => :'Object', :'change_date' => :'Time', :'resource_owner' => :'String', :'creation_date' => :'Time' @@ -58,6 +60,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/session_service_get_session_request.rb b/lib/zitadel/client/models/session_service_get_session_request.rb new file mode 100644 index 00000000..d8df75d7 --- /dev/null +++ b/lib/zitadel/client/models/session_service_get_session_request.rb @@ -0,0 +1,240 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SessionServiceGetSessionRequest + attr_accessor :session_id + + attr_accessor :session_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session_id' => :'sessionId', + :'session_token' => :'sessionToken' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'session_id' => :'String', + :'session_token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'session_token' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceGetSessionRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceGetSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session_id') + self.session_id = attributes[:'session_id'] + end + + if attributes.key?(:'session_token') + self.session_token = attributes[:'session_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session_id == o.session_id && + session_token == o.session_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session_id, session_token].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_header_values.rb b/lib/zitadel/client/models/session_service_header_values.rb new file mode 100644 index 00000000..485ae2f8 --- /dev/null +++ b/lib/zitadel/client/models/session_service_header_values.rb @@ -0,0 +1,233 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. + class SessionServiceHeaderValues + attr_accessor :values + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'values' => :'values' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'values' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceHeaderValues` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceHeaderValues`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + values == o.values + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [values].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_i_ds_query.rb b/lib/zitadel/client/models/session_service_i_ds_query.rb deleted file mode 100644 index 13deb1d9..00000000 --- a/lib/zitadel/client/models/session_service_i_ds_query.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceIDsQuery - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceIDsQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceIDsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_intent_factor.rb b/lib/zitadel/client/models/session_service_intent_factor.rb index 2e7c9a97..702d20ea 100644 --- a/lib/zitadel/client/models/session_service_intent_factor.rb +++ b/lib/zitadel/client/models/session_service_intent_factor.rb @@ -15,7 +15,7 @@ module Zitadel::Client::Models class SessionServiceIntentFactor - # \"time when an intent was last checked\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :verified_at # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/session_service_list_details.rb b/lib/zitadel/client/models/session_service_list_details.rb index 2ba8edb3..abb22678 100644 --- a/lib/zitadel/client/models/session_service_list_details.rb +++ b/lib/zitadel/client/models/session_service_list_details.rb @@ -19,7 +19,7 @@ class SessionServiceListDetails attr_accessor :processed_sequence - # the last time the projection got updated + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :timestamp # Attribute mapping from ruby-style variable name to JSON key. @@ -44,8 +44,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'total_result' => :'String', - :'processed_sequence' => :'String', + :'total_result' => :'Object', + :'processed_sequence' => :'Object', :'timestamp' => :'Time' } end @@ -53,6 +53,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'total_result', + :'processed_sequence', ]) end diff --git a/lib/zitadel/client/models/session_service_list_query.rb b/lib/zitadel/client/models/session_service_list_query.rb index 474220b8..3b4e1a15 100644 --- a/lib/zitadel/client/models/session_service_list_query.rb +++ b/lib/zitadel/client/models/session_service_list_query.rb @@ -14,14 +14,11 @@ require 'time' module Zitadel::Client::Models - # Object unspecific list filters like offset, limit and asc/desc. class SessionServiceListQuery attr_accessor :offset - # Maximum amount of events returned. The default is set to 1000 in https://github.com/zitadel/zitadel/blob/new-eventstore/cmd/zitadel/startup.yaml. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. attr_accessor :limit - # default is descending attr_accessor :asc # Attribute mapping from ruby-style variable name to JSON key. @@ -46,7 +43,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'offset' => :'String', + :'offset' => :'Object', :'limit' => :'Integer', :'asc' => :'Boolean' } @@ -55,6 +52,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'offset', ]) end diff --git a/lib/zitadel/client/models/session_service_list_sessions_request.rb b/lib/zitadel/client/models/session_service_list_sessions_request.rb index 5ae30ae0..103b1715 100644 --- a/lib/zitadel/client/models/session_service_list_sessions_request.rb +++ b/lib/zitadel/client/models/session_service_list_sessions_request.rb @@ -107,8 +107,6 @@ def initialize(attributes = {}) if attributes.key?(:'sorting_column') self.sorting_column = attributes[:'sorting_column'] - else - self.sorting_column = 'SESSION_FIELD_NAME_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/session_service_o_t_p_factor.rb b/lib/zitadel/client/models/session_service_o_t_p_factor.rb index 4ca3a445..011707fc 100644 --- a/lib/zitadel/client/models/session_service_o_t_p_factor.rb +++ b/lib/zitadel/client/models/session_service_o_t_p_factor.rb @@ -15,7 +15,7 @@ module Zitadel::Client::Models class SessionServiceOTPFactor - # \"time when the One-Time Password was last checked\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :verified_at # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/session_service_o_t_p_s_m_s.rb b/lib/zitadel/client/models/session_service_o_t_p_s_m_s.rb new file mode 100644 index 00000000..e4a9b641 --- /dev/null +++ b/lib/zitadel/client/models/session_service_o_t_p_s_m_s.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SessionServiceOTPSMS + attr_accessor :return_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'return_code' => :'returnCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'return_code' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceOTPSMS` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceOTPSMS`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'return_code') + self.return_code = attributes[:'return_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + return_code == o.return_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [return_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/session_service_otp_email.rb b/lib/zitadel/client/models/session_service_otp_email.rb new file mode 100644 index 00000000..18db1c9b --- /dev/null +++ b/lib/zitadel/client/models/session_service_otp_email.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module SessionServiceOTPEmail + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode1', + :'SendCode1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/session_service_password_factor.rb b/lib/zitadel/client/models/session_service_password_factor.rb index 019af5d6..eb9854e5 100644 --- a/lib/zitadel/client/models/session_service_password_factor.rb +++ b/lib/zitadel/client/models/session_service_password_factor.rb @@ -15,7 +15,7 @@ module Zitadel::Client::Models class SessionServicePasswordFactor - # \"time when the password was last checked\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :verified_at # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/session_service_protobuf_any.rb b/lib/zitadel/client/models/session_service_protobuf_any.rb deleted file mode 100644 index 0d1a4038..00000000 --- a/lib/zitadel/client/models/session_service_protobuf_any.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceProtobufAny - attr_accessor :type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'@type' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceProtobufAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_request_challenges.rb b/lib/zitadel/client/models/session_service_request_challenges.rb index a4b73df2..5286e506 100644 --- a/lib/zitadel/client/models/session_service_request_challenges.rb +++ b/lib/zitadel/client/models/session_service_request_challenges.rb @@ -43,9 +43,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'web_auth_n' => :'SessionServiceRequestChallengesWebAuthN', - :'otp_sms' => :'SessionServiceRequestChallengesOTPSMS', - :'otp_email' => :'SessionServiceRequestChallengesOTPEmail' + :'web_auth_n' => :'SessionServiceWebAuthN', + :'otp_sms' => :'SessionServiceOTPSMS', + :'otp_email' => :'SessionServiceOTPEmail' } end diff --git a/lib/zitadel/client/models/session_service_search_query.rb b/lib/zitadel/client/models/session_service_search_query.rb index 4b92a5ea..b5dd9efe 100644 --- a/lib/zitadel/client/models/session_service_search_query.rb +++ b/lib/zitadel/client/models/session_service_search_query.rb @@ -14,253 +14,100 @@ require 'time' module Zitadel::Client::Models - class SessionServiceSearchQuery - attr_accessor :ids_query - - attr_accessor :user_id_query - - attr_accessor :creation_date_query - - attr_accessor :creator_query - - attr_accessor :user_agent_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids_query' => :'idsQuery', - :'user_id_query' => :'userIdQuery', - :'creation_date_query' => :'creationDateQuery', - :'creator_query' => :'creatorQuery', - :'user_agent_query' => :'userAgentQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids_query' => :'SessionServiceIDsQuery', - :'user_id_query' => :'SessionServiceUserIDQuery', - :'creation_date_query' => :'SessionServiceCreationDateQuery', - :'creator_query' => :'SessionServiceCreatorQuery', - :'user_agent_query' => :'SessionServiceUserAgentQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module SessionServiceSearchQuery + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CreationDateQuery1', + :'CreatorQuery', + :'IdsQuery1', + :'UserAgentQuery', + :'UserIdQuery1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'ids_query') - self.ids_query = attributes[:'ids_query'] - end - - if attributes.key?(:'user_id_query') - self.user_id_query = attributes[:'user_id_query'] - end - - if attributes.key?(:'creation_date_query') - self.creation_date_query = attributes[:'creation_date_query'] - end - - if attributes.key?(:'creator_query') - self.creator_query = attributes[:'creator_query'] end - if attributes.key?(:'user_agent_query') - self.user_agent_query = attributes[:'user_agent_query'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids_query == o.ids_query && - user_id_query == o.user_id_query && - creation_date_query == o.creation_date_query && - creator_query == o.creator_query && - user_agent_query == o.user_agent_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids_query, user_id_query, creation_date_query, creator_query, user_agent_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_session.rb b/lib/zitadel/client/models/session_service_session.rb index 4757ec4c..b993eab4 100644 --- a/lib/zitadel/client/models/session_service_session.rb +++ b/lib/zitadel/client/models/session_service_session.rb @@ -15,26 +15,23 @@ module Zitadel::Client::Models class SessionServiceSession - # \"id of the session\" attr_accessor :id - # \"time when the session was created\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date - # \"time when the session was last updated\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date - # \"sequence of the session\" attr_accessor :sequence attr_accessor :factors - # \"custom key value list\" attr_accessor :metadata attr_accessor :user_agent - # \"time the session will be automatically invalidated\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :expiration_date # Attribute mapping from ruby-style variable name to JSON key. @@ -67,7 +64,7 @@ def self.openapi_types :'id' => :'String', :'creation_date' => :'Time', :'change_date' => :'Time', - :'sequence' => :'String', + :'sequence' => :'Object', :'factors' => :'SessionServiceFactors', :'metadata' => :'Hash', :'user_agent' => :'SessionServiceUserAgent', @@ -78,6 +75,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/session_service_set_session_request.rb b/lib/zitadel/client/models/session_service_set_session_request.rb index 983a19d3..b98c486b 100644 --- a/lib/zitadel/client/models/session_service_set_session_request.rb +++ b/lib/zitadel/client/models/session_service_set_session_request.rb @@ -15,22 +15,23 @@ module Zitadel::Client::Models class SessionServiceSetSessionRequest - # \"DEPRECATED: this field is ignored.\" + attr_accessor :session_id + attr_accessor :session_token attr_accessor :checks - # \"custom key value list to be stored on the session\" attr_accessor :metadata attr_accessor :challenges - # \"duration (in seconds) after which the session will be automatically invalidated\" + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". attr_accessor :lifetime # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'session_id' => :'sessionId', :'session_token' => :'sessionToken', :'checks' => :'checks', :'metadata' => :'metadata', @@ -52,6 +53,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'session_id' => :'String', :'session_token' => :'String', :'checks' => :'SessionServiceChecks', :'metadata' => :'Hash', @@ -84,6 +86,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'session_id') + self.session_id = attributes[:'session_id'] + end + if attributes.key?(:'session_token') self.session_token = attributes[:'session_token'] end @@ -112,14 +118,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@session_token.nil? && @session_token.to_s.length > 200 - invalid_properties.push('invalid value for "session_token", the character length must be smaller than or equal to 200.') - end - - if !@session_token.nil? && @session_token.to_s.length < 1 - invalid_properties.push('invalid value for "session_token", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -127,34 +125,15 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@session_token.nil? && @session_token.to_s.length > 200 - return false if !@session_token.nil? && @session_token.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] session_token Value to be assigned - def session_token=(session_token) - if session_token.nil? - fail ArgumentError, 'session_token cannot be nil' - end - - if session_token.to_s.length > 200 - fail ArgumentError, 'invalid value for "session_token", the character length must be smaller than or equal to 200.' - end - - if session_token.to_s.length < 1 - fail ArgumentError, 'invalid value for "session_token", the character length must be great than or equal to 1.' - end - - @session_token = session_token - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + session_id == o.session_id && session_token == o.session_token && checks == o.checks && metadata == o.metadata && @@ -171,7 +150,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [session_token, checks, metadata, challenges, lifetime].hash + [session_id, session_token, checks, metadata, challenges, lifetime].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/session_service_set_session_response.rb b/lib/zitadel/client/models/session_service_set_session_response.rb index 9582fd11..a9cee80a 100644 --- a/lib/zitadel/client/models/session_service_set_session_response.rb +++ b/lib/zitadel/client/models/session_service_set_session_response.rb @@ -17,7 +17,6 @@ module Zitadel::Client::Models class SessionServiceSetSessionResponse attr_accessor :details - # \"The current token of the session, which is required for delete session, get session or the request of other resources.\" attr_accessor :session_token attr_accessor :challenges diff --git a/lib/zitadel/client/models/session_service_t_o_t_p_factor.rb b/lib/zitadel/client/models/session_service_t_o_t_p_factor.rb index c5771e18..a6b336d9 100644 --- a/lib/zitadel/client/models/session_service_t_o_t_p_factor.rb +++ b/lib/zitadel/client/models/session_service_t_o_t_p_factor.rb @@ -15,7 +15,7 @@ module Zitadel::Client::Models class SessionServiceTOTPFactor - # \"time when the Time-based One-Time Password was last checked\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :verified_at # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/session_service_timestamp_query_method.rb b/lib/zitadel/client/models/session_service_timestamp_query_method.rb deleted file mode 100644 index 892460cc..00000000 --- a/lib/zitadel/client/models/session_service_timestamp_query_method.rb +++ /dev/null @@ -1,44 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceTimestampQueryMethod - TIMESTAMP_QUERY_METHOD_EQUALS = "TIMESTAMP_QUERY_METHOD_EQUALS".freeze - TIMESTAMP_QUERY_METHOD_GREATER = "TIMESTAMP_QUERY_METHOD_GREATER".freeze - TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = "TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS".freeze - TIMESTAMP_QUERY_METHOD_LESS = "TIMESTAMP_QUERY_METHOD_LESS".freeze - TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = "TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS".freeze - - def self.all_vars - @all_vars ||= [TIMESTAMP_QUERY_METHOD_EQUALS, TIMESTAMP_QUERY_METHOD_GREATER, TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS, TIMESTAMP_QUERY_METHOD_LESS, TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SessionServiceTimestampQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SessionServiceTimestampQueryMethod" - end - end - -end diff --git a/lib/zitadel/client/models/session_service_user_agent.rb b/lib/zitadel/client/models/session_service_user_agent.rb index 6416fcfd..db87bda0 100644 --- a/lib/zitadel/client/models/session_service_user_agent.rb +++ b/lib/zitadel/client/models/session_service_user_agent.rb @@ -49,13 +49,16 @@ def self.openapi_types :'fingerprint_id' => :'String', :'ip' => :'String', :'description' => :'String', - :'header' => :'Hash' + :'header' => :'Hash' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'fingerprint_id', + :'ip', + :'description', ]) end diff --git a/lib/zitadel/client/models/session_service_user_factor.rb b/lib/zitadel/client/models/session_service_user_factor.rb index 5d97f938..1db8cbf6 100644 --- a/lib/zitadel/client/models/session_service_user_factor.rb +++ b/lib/zitadel/client/models/session_service_user_factor.rb @@ -15,19 +15,15 @@ module Zitadel::Client::Models class SessionServiceUserFactor - # \"time when the user was last checked\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :verified_at - # \"id of the checked user\" attr_accessor :id - # \"login name of the checked user\" attr_accessor :login_name - # \"display name of the checked user\" attr_accessor :display_name - # \"organization id of the checked user\" attr_accessor :organization_id # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/session_service_value.rb b/lib/zitadel/client/models/session_service_value.rb new file mode 100644 index 00000000..f621f0df --- /dev/null +++ b/lib/zitadel/client/models/session_service_value.rb @@ -0,0 +1,114 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +# `Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of these variants. Absence of any variant indicates an error. The JSON representation for `Value` is JSON value. +module SessionServiceValue + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'Boolean', + :'Float', + :'Hash', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/session_service_request_challenges_web_auth_n.rb b/lib/zitadel/client/models/session_service_web_auth_n.rb similarity index 93% rename from lib/zitadel/client/models/session_service_request_challenges_web_auth_n.rb rename to lib/zitadel/client/models/session_service_web_auth_n.rb index 33c7350f..b3927ebb 100644 --- a/lib/zitadel/client/models/session_service_request_challenges_web_auth_n.rb +++ b/lib/zitadel/client/models/session_service_web_auth_n.rb @@ -14,8 +14,7 @@ require 'time' module Zitadel::Client::Models - class SessionServiceRequestChallengesWebAuthN - # \"Domain on which the session was created. Will be used in the WebAuthN challenge.\" + class SessionServiceWebAuthN attr_accessor :domain attr_accessor :user_verification_requirement @@ -79,7 +78,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceRequestChallengesWebAuthN` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceWebAuthN` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -87,7 +86,7 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceRequestChallengesWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -101,7 +100,7 @@ def initialize(attributes = {}) if attributes.key?(:'user_verification_requirement') self.user_verification_requirement = attributes[:'user_verification_requirement'] else - self.user_verification_requirement = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED' + self.user_verification_requirement = nil end end @@ -131,7 +130,7 @@ def valid? end # Custom attribute writer method with validation - # @param [Object] domain Value to be assigned + # @param [String] domain Value to be assigned def domain=(domain) if domain.nil? fail ArgumentError, 'domain cannot be nil' @@ -141,7 +140,7 @@ def domain=(domain) end # Custom attribute writer method with validation - # @param [Object] user_verification_requirement Value to be assigned + # @param [SessionServiceUserVerificationRequirement] user_verification_requirement Value to be assigned def user_verification_requirement=(user_verification_requirement) if user_verification_requirement.nil? fail ArgumentError, 'user_verification_requirement cannot be nil' diff --git a/lib/zitadel/client/models/session_service_web_auth_n_factor.rb b/lib/zitadel/client/models/session_service_web_auth_n_factor.rb index f438365a..4c999c41 100644 --- a/lib/zitadel/client/models/session_service_web_auth_n_factor.rb +++ b/lib/zitadel/client/models/session_service_web_auth_n_factor.rb @@ -15,7 +15,7 @@ module Zitadel::Client::Models class SessionServiceWebAuthNFactor - # \"time when the passkey challenge was last checked\" + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :verified_at attr_accessor :user_verified diff --git a/lib/zitadel/client/models/settings_service_any.rb b/lib/zitadel/client/models/settings_service_any.rb new file mode 100644 index 00000000..d55b308b --- /dev/null +++ b/lib/zitadel/client/models/settings_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class SettingsServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_branding_settings.rb b/lib/zitadel/client/models/settings_service_branding_settings.rb index b0016184..1db53c0b 100644 --- a/lib/zitadel/client/models/settings_service_branding_settings.rb +++ b/lib/zitadel/client/models/settings_service_branding_settings.rb @@ -19,13 +19,11 @@ class SettingsServiceBrandingSettings attr_accessor :dark_theme - # url to the font used attr_accessor :font_url - # hides the org suffix on the login form if the scope \"urn:zitadel:iam:org:domain:primary:{domainname}\" is set + # hides the org suffix on the login form if the scope \\\"urn:zitadel:iam:org:domain:primary:{domainname}\\\" is set attr_accessor :hide_login_name_suffix - # boolean to disable the watermark attr_accessor :disable_watermark attr_accessor :resource_owner_type @@ -136,14 +134,10 @@ def initialize(attributes = {}) if attributes.key?(:'resource_owner_type') self.resource_owner_type = attributes[:'resource_owner_type'] - else - self.resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' end if attributes.key?(:'theme_mode') self.theme_mode = attributes[:'theme_mode'] - else - self.theme_mode = 'THEME_MODE_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/settings_service_connect_error.rb b/lib/zitadel/client/models/settings_service_connect_error.rb new file mode 100644 index 00000000..76ac55bc --- /dev/null +++ b/lib/zitadel/client/models/settings_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class SettingsServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'SettingsServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_details.rb b/lib/zitadel/client/models/settings_service_details.rb index cefe1357..624af636 100644 --- a/lib/zitadel/client/models/settings_service_details.rb +++ b/lib/zitadel/client/models/settings_service_details.rb @@ -15,14 +15,16 @@ module Zitadel::Client::Models class SettingsServiceDetails - # on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation attr_accessor :sequence - # on read: the timestamp of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date + # resource_owner is the organization or instance_id an object belongs to attr_accessor :resource_owner + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date # Attribute mapping from ruby-style variable name to JSON key. @@ -48,7 +50,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'sequence' => :'String', + :'sequence' => :'Object', :'change_date' => :'Time', :'resource_owner' => :'String', :'creation_date' => :'Time' @@ -58,6 +60,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/settings_service_domain_settings.rb b/lib/zitadel/client/models/settings_service_domain_settings.rb index 57999128..5a11bfa4 100644 --- a/lib/zitadel/client/models/settings_service_domain_settings.rb +++ b/lib/zitadel/client/models/settings_service_domain_settings.rb @@ -15,13 +15,10 @@ module Zitadel::Client::Models class SettingsServiceDomainSettings - # the username has to end with the domain of its organization attr_accessor :login_name_includes_domain - # defines if organization domains should be verified upon creation, otherwise will be created already verified attr_accessor :require_org_domain_verification - # defines if the SMTP sender address domain should match an existing domain on the instance attr_accessor :smtp_sender_address_matches_instance_domain attr_accessor :resource_owner_type @@ -116,8 +113,6 @@ def initialize(attributes = {}) if attributes.key?(:'resource_owner_type') self.resource_owner_type = attributes[:'resource_owner_type'] - else - self.resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb b/lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb index 033a345a..e52fac89 100644 --- a/lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb +++ b/lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb @@ -15,10 +15,8 @@ module Zitadel::Client::Models class SettingsServiceEmbeddedIframeSettings - # states if iframe embedding is enabled or disabled attr_accessor :enabled - # origins allowed loading ZITADEL in an iframe if enabled. attr_accessor :allowed_origins # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/settings_service_get_active_identity_providers_request.rb b/lib/zitadel/client/models/settings_service_get_active_identity_providers_request.rb new file mode 100644 index 00000000..25751a7b --- /dev/null +++ b/lib/zitadel/client/models/settings_service_get_active_identity_providers_request.rb @@ -0,0 +1,270 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SettingsServiceGetActiveIdentityProvidersRequest + attr_accessor :ctx + + attr_accessor :creation_allowed + + attr_accessor :linking_allowed + + attr_accessor :auto_creation + + attr_accessor :auto_linking + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx', + :'creation_allowed' => :'creationAllowed', + :'linking_allowed' => :'linkingAllowed', + :'auto_creation' => :'autoCreation', + :'auto_linking' => :'autoLinking' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'SettingsServiceRequestContext', + :'creation_allowed' => :'Boolean', + :'linking_allowed' => :'Boolean', + :'auto_creation' => :'Boolean', + :'auto_linking' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'creation_allowed', + :'linking_allowed', + :'auto_creation', + :'auto_linking' + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetActiveIdentityProvidersRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetActiveIdentityProvidersRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + + if attributes.key?(:'creation_allowed') + self.creation_allowed = attributes[:'creation_allowed'] + end + + if attributes.key?(:'linking_allowed') + self.linking_allowed = attributes[:'linking_allowed'] + end + + if attributes.key?(:'auto_creation') + self.auto_creation = attributes[:'auto_creation'] + end + + if attributes.key?(:'auto_linking') + self.auto_linking = attributes[:'auto_linking'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx && + creation_allowed == o.creation_allowed && + linking_allowed == o.linking_allowed && + auto_creation == o.auto_creation && + auto_linking == o.auto_linking + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx, creation_allowed, linking_allowed, auto_creation, auto_linking].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_get_branding_settings_request.rb b/lib/zitadel/client/models/settings_service_get_branding_settings_request.rb new file mode 100644 index 00000000..a2c13122 --- /dev/null +++ b/lib/zitadel/client/models/settings_service_get_branding_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SettingsServiceGetBrandingSettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'SettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetBrandingSettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetBrandingSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_get_domain_settings_request.rb b/lib/zitadel/client/models/settings_service_get_domain_settings_request.rb new file mode 100644 index 00000000..86191cba --- /dev/null +++ b/lib/zitadel/client/models/settings_service_get_domain_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SettingsServiceGetDomainSettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'SettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetDomainSettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetDomainSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_get_general_settings_response.rb b/lib/zitadel/client/models/settings_service_get_general_settings_response.rb index 24d1fec1..0a79ef50 100644 --- a/lib/zitadel/client/models/settings_service_get_general_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_general_settings_response.rb @@ -15,10 +15,8 @@ module Zitadel::Client::Models class SettingsServiceGetGeneralSettingsResponse - # default organization for the current context attr_accessor :default_org_id - # default language for the current context attr_accessor :default_language attr_accessor :supported_languages diff --git a/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rb b/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rb new file mode 100644 index 00000000..596da15c --- /dev/null +++ b/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SettingsServiceGetLegalAndSupportSettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'SettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLegalAndSupportSettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLegalAndSupportSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_get_lockout_settings_request.rb b/lib/zitadel/client/models/settings_service_get_lockout_settings_request.rb new file mode 100644 index 00000000..08d3c0df --- /dev/null +++ b/lib/zitadel/client/models/settings_service_get_lockout_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SettingsServiceGetLockoutSettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'SettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLockoutSettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLockoutSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_protobuf_any.rb b/lib/zitadel/client/models/settings_service_get_login_settings_request.rb similarity index 92% rename from lib/zitadel/client/models/action_service_protobuf_any.rb rename to lib/zitadel/client/models/settings_service_get_login_settings_request.rb index 6d6c2ac2..bfa69046 100644 --- a/lib/zitadel/client/models/action_service_protobuf_any.rb +++ b/lib/zitadel/client/models/settings_service_get_login_settings_request.rb @@ -14,13 +14,13 @@ require 'time' module Zitadel::Client::Models - class ActionServiceProtobufAny - attr_accessor :type + class SettingsServiceGetLoginSettingsRequest + attr_accessor :ctx # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'type' => :'@type' + :'ctx' => :'ctx' } end @@ -37,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'type' => :'String' + :'ctx' => :'SettingsServiceRequestContext' } end @@ -52,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceProtobufAny` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLoginSettingsRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -60,13 +60,13 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceProtobufAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLoginSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] end end @@ -90,7 +90,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type + ctx == o.ctx end # @see the `==` method @@ -102,7 +102,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type].hash + [ctx].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/settings_service_get_password_complexity_settings_request.rb b/lib/zitadel/client/models/settings_service_get_password_complexity_settings_request.rb new file mode 100644 index 00000000..5caabc53 --- /dev/null +++ b/lib/zitadel/client/models/settings_service_get_password_complexity_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SettingsServiceGetPasswordComplexitySettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'SettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetPasswordComplexitySettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetPasswordComplexitySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_get_password_expiry_settings_request.rb b/lib/zitadel/client/models/settings_service_get_password_expiry_settings_request.rb new file mode 100644 index 00000000..97911576 --- /dev/null +++ b/lib/zitadel/client/models/settings_service_get_password_expiry_settings_request.rb @@ -0,0 +1,230 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class SettingsServiceGetPasswordExpirySettingsRequest + attr_accessor :ctx + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ctx' => :'ctx' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ctx' => :'SettingsServiceRequestContext' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetPasswordExpirySettingsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetPasswordExpirySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ctx') + self.ctx = attributes[:'ctx'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ctx == o.ctx + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ctx].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/settings_service_identity_provider.rb b/lib/zitadel/client/models/settings_service_identity_provider.rb index 3a5dfaa0..6d2dd477 100644 --- a/lib/zitadel/client/models/settings_service_identity_provider.rb +++ b/lib/zitadel/client/models/settings_service_identity_provider.rb @@ -109,8 +109,6 @@ def initialize(attributes = {}) if attributes.key?(:'type') self.type = attributes[:'type'] - else - self.type = 'IDENTITY_PROVIDER_TYPE_UNSPECIFIED' end if attributes.key?(:'options') diff --git a/lib/zitadel/client/models/settings_service_legal_and_support_settings.rb b/lib/zitadel/client/models/settings_service_legal_and_support_settings.rb index 35a27227..21b29118 100644 --- a/lib/zitadel/client/models/settings_service_legal_and_support_settings.rb +++ b/lib/zitadel/client/models/settings_service_legal_and_support_settings.rb @@ -21,18 +21,14 @@ class SettingsServiceLegalAndSupportSettings attr_accessor :help_link - # help / support email address. attr_accessor :support_email attr_accessor :resource_owner_type - # Link to documentation to be shown in the console. attr_accessor :docs_link - # Link to an external resource that will be available to users in the console. attr_accessor :custom_link - # The button text that would be shown in console pointing to custom link. attr_accessor :custom_link_text class EnumAttributeValidator @@ -137,8 +133,6 @@ def initialize(attributes = {}) if attributes.key?(:'resource_owner_type') self.resource_owner_type = attributes[:'resource_owner_type'] - else - self.resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' end if attributes.key?(:'docs_link') diff --git a/lib/zitadel/client/models/settings_service_list_details.rb b/lib/zitadel/client/models/settings_service_list_details.rb index 9ce658f1..9f1d9ea4 100644 --- a/lib/zitadel/client/models/settings_service_list_details.rb +++ b/lib/zitadel/client/models/settings_service_list_details.rb @@ -19,7 +19,7 @@ class SettingsServiceListDetails attr_accessor :processed_sequence - # the last time the projection got updated + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :timestamp # Attribute mapping from ruby-style variable name to JSON key. @@ -44,8 +44,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'total_result' => :'String', - :'processed_sequence' => :'String', + :'total_result' => :'Object', + :'processed_sequence' => :'Object', :'timestamp' => :'Time' } end @@ -53,6 +53,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'total_result', + :'processed_sequence', ]) end diff --git a/lib/zitadel/client/models/settings_service_lockout_settings.rb b/lib/zitadel/client/models/settings_service_lockout_settings.rb index e9962bb2..b5974e02 100644 --- a/lib/zitadel/client/models/settings_service_lockout_settings.rb +++ b/lib/zitadel/client/models/settings_service_lockout_settings.rb @@ -15,12 +15,10 @@ module Zitadel::Client::Models class SettingsServiceLockoutSettings - # Maximum password check attempts before the account gets locked. Attempts are reset as soon as the password is entered correctly or the password is reset. If set to 0 the account will never be locked. attr_accessor :max_password_attempts attr_accessor :resource_owner_type - # Maximum failed attempts for a single OTP type (TOTP, SMS, Email) before the account gets locked. Attempts are reset as soon as the OTP is entered correctly. If set to 0 the account will never be locked. attr_accessor :max_otp_attempts class EnumAttributeValidator @@ -67,15 +65,17 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'max_password_attempts' => :'String', + :'max_password_attempts' => :'Object', :'resource_owner_type' => :'SettingsServiceResourceOwnerType', - :'max_otp_attempts' => :'String' + :'max_otp_attempts' => :'Object' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'max_password_attempts', + :'max_otp_attempts' ]) end @@ -103,8 +103,6 @@ def initialize(attributes = {}) if attributes.key?(:'resource_owner_type') self.resource_owner_type = attributes[:'resource_owner_type'] - else - self.resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' end if attributes.key?(:'max_otp_attempts') diff --git a/lib/zitadel/client/models/settings_service_login_settings.rb b/lib/zitadel/client/models/settings_service_login_settings.rb index 088100f2..26bd1974 100644 --- a/lib/zitadel/client/models/settings_service_login_settings.rb +++ b/lib/zitadel/client/models/settings_service_login_settings.rb @@ -15,42 +15,35 @@ module Zitadel::Client::Models class SettingsServiceLoginSettings - # defines if a user is allowed to log in with username and password attr_accessor :allow_username_password - # defines if a person is allowed to register a user on this organization attr_accessor :allow_register - # defines if a user is allowed to add a defined identity provider. E.g. Google auth attr_accessor :allow_external_idp - # defines if a user MUST use a multi-factor to log in attr_accessor :force_mfa attr_accessor :passkeys_type - # defines if password reset link should be shown in the login screen attr_accessor :hide_password_reset - # defines if unknown username on login screen directly returns an error or always displays the password screen attr_accessor :ignore_unknown_usernames - # defines where the user will be redirected to if the login is started without app context (e.g. from mail) attr_accessor :default_redirect_uri - # Defines after how much time the user has to re-authenticate with the password. + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". attr_accessor :password_check_lifetime - # Defines after how much time the user has to re-authenticate with an external provider. + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". attr_accessor :external_login_check_lifetime - # Defines after how much time the mfa prompt will be shown again. + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". attr_accessor :mfa_init_skip_lifetime - # Defines after how long the second factor check is valid. + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". attr_accessor :second_factor_check_lifetime - # Defines how long the multi-factor check is valid. + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". attr_accessor :multi_factor_check_lifetime attr_accessor :second_factors @@ -60,15 +53,12 @@ class SettingsServiceLoginSettings # If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the org domains and will redirect to the registration of that organization on success. attr_accessor :allow_domain_discovery - # defines if the user can additionally (to the login name) be identified by their verified email address attr_accessor :disable_login_with_email - # defines if the user can additionally (to the login name) be identified by their verified phone number attr_accessor :disable_login_with_phone attr_accessor :resource_owner_type - # if activated, only local authenticated users are forced to use MFA. Authentication through IDPs won't prompt a MFA step in the login. attr_accessor :force_mfa_local_only class EnumAttributeValidator @@ -197,8 +187,6 @@ def initialize(attributes = {}) if attributes.key?(:'passkeys_type') self.passkeys_type = attributes[:'passkeys_type'] - else - self.passkeys_type = 'PASSKEYS_TYPE_NOT_ALLOWED' end if attributes.key?(:'hide_password_reset') @@ -259,8 +247,6 @@ def initialize(attributes = {}) if attributes.key?(:'resource_owner_type') self.resource_owner_type = attributes[:'resource_owner_type'] - else - self.resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' end if attributes.key?(:'force_mfa_local_only') diff --git a/lib/zitadel/client/models/settings_service_options.rb b/lib/zitadel/client/models/settings_service_options.rb index 7d665fb7..28d0cc41 100644 --- a/lib/zitadel/client/models/settings_service_options.rb +++ b/lib/zitadel/client/models/settings_service_options.rb @@ -15,16 +15,16 @@ module Zitadel::Client::Models class SettingsServiceOptions - # Enable if users should be able to link an existing ZITADEL user with an external account. + # Enable if users should be able to link an existing ZITADEL user with an external account. attr_accessor :is_linking_allowed - # Enable if users should be able to create a new account in ZITADEL when using an external account. + # Enable if users should be able to create a new account in ZITADEL when using an external account. attr_accessor :is_creation_allowed - # Enable if a new account in ZITADEL should be created automatically when login with an external account. + # Enable if a new account in ZITADEL should be created automatically when login with an external account. attr_accessor :is_auto_creation - # Enable if a the ZITADEL account fields should be updated automatically on each login. + # Enable if a the ZITADEL account fields should be updated automatically on each login. attr_accessor :is_auto_update attr_accessor :auto_linking @@ -125,8 +125,6 @@ def initialize(attributes = {}) if attributes.key?(:'auto_linking') self.auto_linking = attributes[:'auto_linking'] - else - self.auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/settings_service_password_complexity_settings.rb b/lib/zitadel/client/models/settings_service_password_complexity_settings.rb index ba59b76f..c9f6c7fa 100644 --- a/lib/zitadel/client/models/settings_service_password_complexity_settings.rb +++ b/lib/zitadel/client/models/settings_service_password_complexity_settings.rb @@ -15,19 +15,14 @@ module Zitadel::Client::Models class SettingsServicePasswordComplexitySettings - # Defines the minimum length of a password. attr_accessor :min_length - # defines if the password MUST contain an upper case letter attr_accessor :requires_uppercase - # defines if the password MUST contain a lowercase letter attr_accessor :requires_lowercase - # defines if the password MUST contain a number attr_accessor :requires_number - # defines if the password MUST contain a symbol. E.g. \"$\" attr_accessor :requires_symbol attr_accessor :resource_owner_type @@ -79,7 +74,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'min_length' => :'String', + :'min_length' => :'Object', :'requires_uppercase' => :'Boolean', :'requires_lowercase' => :'Boolean', :'requires_number' => :'Boolean', @@ -91,6 +86,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'min_length', ]) end @@ -134,8 +130,6 @@ def initialize(attributes = {}) if attributes.key?(:'resource_owner_type') self.resource_owner_type = attributes[:'resource_owner_type'] - else - self.resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/settings_service_password_expiry_settings.rb b/lib/zitadel/client/models/settings_service_password_expiry_settings.rb index b62cd49d..a729fd02 100644 --- a/lib/zitadel/client/models/settings_service_password_expiry_settings.rb +++ b/lib/zitadel/client/models/settings_service_password_expiry_settings.rb @@ -67,8 +67,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'max_age_days' => :'String', - :'expire_warn_days' => :'String', + :'max_age_days' => :'Object', + :'expire_warn_days' => :'Object', :'resource_owner_type' => :'SettingsServiceResourceOwnerType' } end @@ -76,6 +76,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'max_age_days', + :'expire_warn_days', ]) end @@ -107,8 +109,6 @@ def initialize(attributes = {}) if attributes.key?(:'resource_owner_type') self.resource_owner_type = attributes[:'resource_owner_type'] - else - self.resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' end end diff --git a/lib/zitadel/client/models/settings_service_request_context.rb b/lib/zitadel/client/models/settings_service_request_context.rb new file mode 100644 index 00000000..42429694 --- /dev/null +++ b/lib/zitadel/client/models/settings_service_request_context.rb @@ -0,0 +1,110 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module SettingsServiceRequestContext + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Instance', + :'OrgId' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/settings_service_security_settings.rb b/lib/zitadel/client/models/settings_service_security_settings.rb index a7bc40ee..dbd67507 100644 --- a/lib/zitadel/client/models/settings_service_security_settings.rb +++ b/lib/zitadel/client/models/settings_service_security_settings.rb @@ -17,7 +17,6 @@ module Zitadel::Client::Models class SettingsServiceSecuritySettings attr_accessor :embedded_iframe - # default language for the current context attr_accessor :enable_impersonation # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/settings_service_set_security_settings_request.rb b/lib/zitadel/client/models/settings_service_set_security_settings_request.rb index 0316d361..ea21f75f 100644 --- a/lib/zitadel/client/models/settings_service_set_security_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_set_security_settings_request.rb @@ -17,7 +17,6 @@ module Zitadel::Client::Models class SettingsServiceSetSecuritySettingsRequest attr_accessor :embedded_iframe - # allows users to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well attr_accessor :enable_impersonation # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/settings_service_theme.rb b/lib/zitadel/client/models/settings_service_theme.rb index a85624ee..478b2121 100644 --- a/lib/zitadel/client/models/settings_service_theme.rb +++ b/lib/zitadel/client/models/settings_service_theme.rb @@ -21,16 +21,16 @@ class SettingsServiceTheme # hex value for background color attr_accessor :background_color - # hex value for warn color + # hex value for warning color attr_accessor :warn_color # hex value for font color attr_accessor :font_color - # url to the logo + # url where the logo is served attr_accessor :logo_url - # url to the icon + # url where the icon is served attr_accessor :icon_url # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/zitadel/client/models/state_query.rb b/lib/zitadel/client/models/state_query.rb new file mode 100644 index 00000000..c5422ce4 --- /dev/null +++ b/lib/zitadel/client/models/state_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class StateQuery + attr_accessor :state_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_query' => :'stateQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'state_query' => :'UserServiceStateQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::StateQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::StateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'state_query') + self.state_query = attributes[:'state_query'] + else + self.state_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @state_query.nil? + invalid_properties.push('invalid value for "state_query", state_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @state_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceStateQuery] state_query Value to be assigned + def state_query=(state_query) + if state_query.nil? + fail ArgumentError, 'state_query cannot be nil' + end + + @state_query = state_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + state_query == o.state_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [state_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/state_query1.rb b/lib/zitadel/client/models/state_query1.rb new file mode 100644 index 00000000..f56dced2 --- /dev/null +++ b/lib/zitadel/client/models/state_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class StateQuery1 + attr_accessor :state_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_query' => :'stateQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'state_query' => :'OrganizationServiceOrganizationStateQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::StateQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::StateQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'state_query') + self.state_query = attributes[:'state_query'] + else + self.state_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @state_query.nil? + invalid_properties.push('invalid value for "state_query", state_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @state_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [OrganizationServiceOrganizationStateQuery] state_query Value to be assigned + def state_query=(state_query) + if state_query.nil? + fail ArgumentError, 'state_query cannot be nil' + end + + @state_query = state_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + state_query == o.state_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [state_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/state_query2.rb b/lib/zitadel/client/models/state_query2.rb new file mode 100644 index 00000000..5bb1a661 --- /dev/null +++ b/lib/zitadel/client/models/state_query2.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class StateQuery2 + attr_accessor :state_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_query' => :'stateQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'state_query' => :'BetaUserServiceStateQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::StateQuery2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::StateQuery2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'state_query') + self.state_query = attributes[:'state_query'] + else + self.state_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @state_query.nil? + invalid_properties.push('invalid value for "state_query", state_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @state_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceStateQuery] state_query Value to be assigned + def state_query=(state_query) + if state_query.nil? + fail ArgumentError, 'state_query cannot be nil' + end + + @state_query = state_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + state_query == o.state_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [state_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/target_filter.rb b/lib/zitadel/client/models/target_filter.rb new file mode 100644 index 00000000..407f0f1e --- /dev/null +++ b/lib/zitadel/client/models/target_filter.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class TargetFilter + attr_accessor :target_filter + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'target_filter' => :'targetFilter' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'target_filter' => :'BetaActionServiceTargetFilter' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::TargetFilter` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::TargetFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'target_filter') + self.target_filter = attributes[:'target_filter'] + else + self.target_filter = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @target_filter.nil? + invalid_properties.push('invalid value for "target_filter", target_filter cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @target_filter.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceTargetFilter] target_filter Value to be assigned + def target_filter=(target_filter) + if target_filter.nil? + fail ArgumentError, 'target_filter cannot be nil' + end + + @target_filter = target_filter + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + target_filter == o.target_filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [target_filter].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/target_name_filter.rb b/lib/zitadel/client/models/target_name_filter.rb new file mode 100644 index 00000000..fd5c0b57 --- /dev/null +++ b/lib/zitadel/client/models/target_name_filter.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class TargetNameFilter + attr_accessor :target_name_filter + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'target_name_filter' => :'targetNameFilter' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'target_name_filter' => :'BetaActionServiceTargetNameFilter' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::TargetNameFilter` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::TargetNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'target_name_filter') + self.target_name_filter = attributes[:'target_name_filter'] + else + self.target_name_filter = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @target_name_filter.nil? + invalid_properties.push('invalid value for "target_name_filter", target_name_filter cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @target_name_filter.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaActionServiceTargetNameFilter] target_name_filter Value to be assigned + def target_name_filter=(target_name_filter) + if target_name_filter.nil? + fail ArgumentError, 'target_name_filter cannot be nil' + end + + @target_name_filter = target_name_filter + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + target_name_filter == o.target_name_filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [target_name_filter].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/type_query.rb b/lib/zitadel/client/models/type_query.rb new file mode 100644 index 00000000..7794118d --- /dev/null +++ b/lib/zitadel/client/models/type_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class TypeQuery + attr_accessor :type_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type_query' => :'typeQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type_query' => :'UserServiceTypeQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::TypeQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::TypeQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type_query') + self.type_query = attributes[:'type_query'] + else + self.type_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type_query.nil? + invalid_properties.push('invalid value for "type_query", type_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceTypeQuery] type_query Value to be assigned + def type_query=(type_query) + if type_query.nil? + fail ArgumentError, 'type_query cannot be nil' + end + + @type_query = type_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type_query == o.type_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/type_query1.rb b/lib/zitadel/client/models/type_query1.rb new file mode 100644 index 00000000..ff578b46 --- /dev/null +++ b/lib/zitadel/client/models/type_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class TypeQuery1 + attr_accessor :type_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type_query' => :'typeQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type_query' => :'BetaUserServiceTypeQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::TypeQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::TypeQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type_query') + self.type_query = attributes[:'type_query'] + else + self.type_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type_query.nil? + invalid_properties.push('invalid value for "type_query", type_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceTypeQuery] type_query Value to be assigned + def type_query=(type_query) + if type_query.nil? + fail ArgumentError, 'type_query cannot be nil' + end + + @type_query = type_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type_query == o.type_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/u2f.rb b/lib/zitadel/client/models/u2f.rb new file mode 100644 index 00000000..34627279 --- /dev/null +++ b/lib/zitadel/client/models/u2f.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class U2f + attr_accessor :u2f + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'u2f' => :'u2f' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'u2f' => :'UserServiceAuthFactorU2F' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::U2f` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::U2f`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'u2f') + self.u2f = attributes[:'u2f'] + else + self.u2f = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @u2f.nil? + invalid_properties.push('invalid value for "u2f", u2f cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @u2f.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceAuthFactorU2F] u2f Value to be assigned + def u2f=(u2f) + if u2f.nil? + fail ArgumentError, 'u2f cannot be nil' + end + + @u2f = u2f + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + u2f == o.u2f + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [u2f].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/urls.rb b/lib/zitadel/client/models/urls.rb new file mode 100644 index 00000000..283bebec --- /dev/null +++ b/lib/zitadel/client/models/urls.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Urls + attr_accessor :urls + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'urls' => :'urls' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'urls' => :'UserServiceRedirectURLs' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Urls` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Urls`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'urls') + self.urls = attributes[:'urls'] + else + self.urls = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @urls.nil? + invalid_properties.push('invalid value for "urls", urls cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @urls.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceRedirectURLs] urls Value to be assigned + def urls=(urls) + if urls.nil? + fail ArgumentError, 'urls cannot be nil' + end + + @urls = urls + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + urls == o.urls + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [urls].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/urls1.rb b/lib/zitadel/client/models/urls1.rb new file mode 100644 index 00000000..fc69d728 --- /dev/null +++ b/lib/zitadel/client/models/urls1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class Urls1 + attr_accessor :urls + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'urls' => :'urls' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'urls' => :'BetaUserServiceRedirectURLs' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::Urls1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::Urls1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'urls') + self.urls = attributes[:'urls'] + else + self.urls = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @urls.nil? + invalid_properties.push('invalid value for "urls", urls cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @urls.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceRedirectURLs] urls Value to be assigned + def urls=(urls) + if urls.nil? + fail ArgumentError, 'urls cannot be nil' + end + + @urls = urls + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + urls == o.urls + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [urls].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_agent_query.rb b/lib/zitadel/client/models/user_agent_query.rb new file mode 100644 index 00000000..4940319f --- /dev/null +++ b/lib/zitadel/client/models/user_agent_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserAgentQuery + attr_accessor :user_agent_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_agent_query' => :'userAgentQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_agent_query' => :'SessionServiceUserAgentQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserAgentQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserAgentQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_agent_query') + self.user_agent_query = attributes[:'user_agent_query'] + else + self.user_agent_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_agent_query.nil? + invalid_properties.push('invalid value for "user_agent_query", user_agent_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_agent_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [SessionServiceUserAgentQuery] user_agent_query Value to be assigned + def user_agent_query=(user_agent_query) + if user_agent_query.nil? + fail ArgumentError, 'user_agent_query cannot be nil' + end + + @user_agent_query = user_agent_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_agent_query == o.user_agent_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_agent_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_id.rb b/lib/zitadel/client/models/user_id.rb new file mode 100644 index 00000000..dabb17d0 --- /dev/null +++ b/lib/zitadel/client/models/user_id.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserId + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserId` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserId`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_id_query.rb b/lib/zitadel/client/models/user_id_query.rb new file mode 100644 index 00000000..0b407235 --- /dev/null +++ b/lib/zitadel/client/models/user_id_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserIdQuery + attr_accessor :user_id_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id_query' => :'userIdQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id_query' => :'BetaSessionServiceUserIDQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserIdQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserIdQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id_query') + self.user_id_query = attributes[:'user_id_query'] + else + self.user_id_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id_query.nil? + invalid_properties.push('invalid value for "user_id_query", user_id_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaSessionServiceUserIDQuery] user_id_query Value to be assigned + def user_id_query=(user_id_query) + if user_id_query.nil? + fail ArgumentError, 'user_id_query cannot be nil' + end + + @user_id_query = user_id_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id_query == o.user_id_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_id_query1.rb b/lib/zitadel/client/models/user_id_query1.rb new file mode 100644 index 00000000..a0de3c83 --- /dev/null +++ b/lib/zitadel/client/models/user_id_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserIdQuery1 + attr_accessor :user_id_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id_query' => :'userIdQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id_query' => :'SessionServiceUserIDQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserIdQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserIdQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id_query') + self.user_id_query = attributes[:'user_id_query'] + else + self.user_id_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id_query.nil? + invalid_properties.push('invalid value for "user_id_query", user_id_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [SessionServiceUserIDQuery] user_id_query Value to be assigned + def user_id_query=(user_id_query) + if user_id_query.nil? + fail ArgumentError, 'user_id_query cannot be nil' + end + + @user_id_query = user_id_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id_query == o.user_id_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_name_query.rb b/lib/zitadel/client/models/user_name_query.rb new file mode 100644 index 00000000..193a6db2 --- /dev/null +++ b/lib/zitadel/client/models/user_name_query.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserNameQuery + attr_accessor :user_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_name_query' => :'userNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_name_query' => :'UserServiceUserNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserNameQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_name_query') + self.user_name_query = attributes[:'user_name_query'] + else + self.user_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_name_query.nil? + invalid_properties.push('invalid value for "user_name_query", user_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [UserServiceUserNameQuery] user_name_query Value to be assigned + def user_name_query=(user_name_query) + if user_name_query.nil? + fail ArgumentError, 'user_name_query cannot be nil' + end + + @user_name_query = user_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_name_query == o.user_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_name_query1.rb b/lib/zitadel/client/models/user_name_query1.rb new file mode 100644 index 00000000..81671712 --- /dev/null +++ b/lib/zitadel/client/models/user_name_query1.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserNameQuery1 + attr_accessor :user_name_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_name_query' => :'userNameQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_name_query' => :'BetaUserServiceUserNameQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserNameQuery1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserNameQuery1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_name_query') + self.user_name_query = attributes[:'user_name_query'] + else + self.user_name_query = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_name_query.nil? + invalid_properties.push('invalid value for "user_name_query", user_name_query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_name_query.nil? + true + end + + # Custom attribute writer method with validation + # @param [BetaUserServiceUserNameQuery] user_name_query Value to be assigned + def user_name_query=(user_name_query) + if user_name_query.nil? + fail ArgumentError, 'user_name_query cannot be nil' + end + + @user_name_query = user_name_query + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_name_query == o.user_name_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_name_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_add_human_user_request.rb b/lib/zitadel/client/models/user_service_add_human_user_request.rb index 561c15e9..edcd2857 100644 --- a/lib/zitadel/client/models/user_service_add_human_user_request.rb +++ b/lib/zitadel/client/models/user_service_add_human_user_request.rb @@ -14,432 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceAddHumanUserRequest - # optionally set your own id unique for the user. - attr_accessor :user_id - - # optionally set a unique username, if none is provided the email will be used. - attr_accessor :username - - attr_accessor :organization - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :metadata - - attr_accessor :password - - attr_accessor :hashed_password - - attr_accessor :idp_links - - # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. - attr_accessor :totp_secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'organization' => :'organization', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'metadata' => :'metadata', - :'password' => :'password', - :'hashed_password' => :'hashedPassword', - :'idp_links' => :'idpLinks', - :'totp_secret' => :'totpSecret' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'organization' => :'UserServiceOrganization', - :'profile' => :'UserServiceSetHumanProfile', - :'email' => :'UserServiceSetHumanEmail', - :'phone' => :'UserServiceSetHumanPhone', - :'metadata' => :'Array', - :'password' => :'UserServicePassword', - :'hashed_password' => :'UserServiceHashedPassword', - :'idp_links' => :'Array', - :'totp_secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddHumanUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceAddHumanUserRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'HashedPassword', + :'Password' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - else - self.profile = nil - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - else - self.email = nil end - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call end - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'hashed_password') - self.hashed_password = attributes[:'hashed_password'] - end - - if attributes.key?(:'idp_links') - if (value = attributes[:'idp_links']).is_a?(Array) - self.idp_links = value + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end end end - if attributes.key?(:'totp_secret') - self.totp_secret = attributes[:'totp_secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@user_id.nil? && @user_id.to_s.length > 200 - invalid_properties.push('invalid value for "user_id", the character length must be smaller than or equal to 200.') - end - - if !@user_id.nil? && @user_id.to_s.length < 1 - invalid_properties.push('invalid value for "user_id", the character length must be great than or equal to 1.') - end - - if !@username.nil? && @username.to_s.length > 200 - invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 200.') - end - - if !@username.nil? && @username.to_s.length < 1 - invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.') - end - - if @profile.nil? - invalid_properties.push('invalid value for "profile", profile cannot be nil.') - end - - if @email.nil? - invalid_properties.push('invalid value for "email", email cannot be nil.') - end - - if !@totp_secret.nil? && @totp_secret.to_s.length > 200 - invalid_properties.push('invalid value for "totp_secret", the character length must be smaller than or equal to 200.') - end - - if !@totp_secret.nil? && @totp_secret.to_s.length < 1 - invalid_properties.push('invalid value for "totp_secret", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@user_id.nil? && @user_id.to_s.length > 200 - return false if !@user_id.nil? && @user_id.to_s.length < 1 - return false if !@username.nil? && @username.to_s.length > 200 - return false if !@username.nil? && @username.to_s.length < 1 - return false if @profile.nil? - return false if @email.nil? - return false if !@totp_secret.nil? && @totp_secret.to_s.length > 200 - return false if !@totp_secret.nil? && @totp_secret.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] user_id Value to be assigned - def user_id=(user_id) - if user_id.nil? - fail ArgumentError, 'user_id cannot be nil' - end - - if user_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_id", the character length must be smaller than or equal to 200.' - end - - if user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "user_id", the character length must be great than or equal to 1.' - end - - @user_id = user_id - end - - # Custom attribute writer method with validation - # @param [Object] username Value to be assigned - def username=(username) - if username.nil? - fail ArgumentError, 'username cannot be nil' - end - - if username.to_s.length > 200 - fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 200.' - end - - if username.to_s.length < 1 - fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.' - end - - @username = username - end - - # Custom attribute writer method with validation - # @param [Object] profile Value to be assigned - def profile=(profile) - if profile.nil? - fail ArgumentError, 'profile cannot be nil' - end - - @profile = profile - end - - # Custom attribute writer method with validation - # @param [Object] email Value to be assigned - def email=(email) - if email.nil? - fail ArgumentError, 'email cannot be nil' - end - - @email = email - end - - # Custom attribute writer method with validation - # @param [Object] totp_secret Value to be assigned - def totp_secret=(totp_secret) - if totp_secret.nil? - fail ArgumentError, 'totp_secret cannot be nil' - end - - if totp_secret.to_s.length > 200 - fail ArgumentError, 'invalid value for "totp_secret", the character length must be smaller than or equal to 200.' - end - - if totp_secret.to_s.length < 1 - fail ArgumentError, 'invalid value for "totp_secret", the character length must be great than or equal to 1.' - end - - @totp_secret = totp_secret - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - organization == o.organization && - profile == o.profile && - email == o.email && - phone == o.phone && - metadata == o.metadata && - password == o.password && - hashed_password == o.hashed_password && - idp_links == o.idp_links && - totp_secret == o.totp_secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, organization, profile, email, phone, metadata, password, hashed_password, idp_links, totp_secret].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_add_human_user_response.rb b/lib/zitadel/client/models/user_service_add_human_user_response.rb index 28cb54ef..37e66be5 100644 --- a/lib/zitadel/client/models/user_service_add_human_user_response.rb +++ b/lib/zitadel/client/models/user_service_add_human_user_response.rb @@ -56,6 +56,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'email_code', + :'phone_code' ]) end diff --git a/lib/zitadel/client/models/user_service_add_i_d_p_link_request.rb b/lib/zitadel/client/models/user_service_add_i_d_p_link_request.rb index 6aef28bf..e0e3d2bf 100644 --- a/lib/zitadel/client/models/user_service_add_i_d_p_link_request.rb +++ b/lib/zitadel/client/models/user_service_add_i_d_p_link_request.rb @@ -15,11 +15,14 @@ module Zitadel::Client::Models class UserServiceAddIDPLinkRequest + attr_accessor :user_id + attr_accessor :idp_link # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'idp_link' => :'idpLink' } end @@ -37,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'idp_link' => :'UserServiceIDPLink' } end @@ -65,6 +69,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + if attributes.key?(:'idp_link') self.idp_link = attributes[:'idp_link'] end @@ -75,6 +85,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -82,14 +96,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && idp_link == o.idp_link end @@ -102,7 +128,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [idp_link].hash + [user_id, idp_link].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_add_o_t_p_email_request.rb b/lib/zitadel/client/models/user_service_add_o_t_p_email_request.rb new file mode 100644 index 00000000..173ed44d --- /dev/null +++ b/lib/zitadel/client/models/user_service_add_o_t_p_email_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceAddOTPEmailRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddOTPEmailRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddOTPEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_request.rb b/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_request.rb new file mode 100644 index 00000000..a9d33e1f --- /dev/null +++ b/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceAddOTPSMSRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddOTPSMSRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddOTPSMSRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_any.rb b/lib/zitadel/client/models/user_service_any.rb new file mode 100644 index 00000000..5bb48810 --- /dev/null +++ b/lib/zitadel/client/models/user_service_any.rb @@ -0,0 +1,251 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + class UserServiceAny + attr_accessor :type + + attr_accessor :value + + attr_accessor :debug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'debug' => :'debug' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'value' => :'File', + :'debug' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'debug') + if (value = attributes[:'debug']).is_a?(Hash) + self.debug = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + debug == o.debug + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, debug].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_auth_factor.rb b/lib/zitadel/client/models/user_service_auth_factor.rb index 1bcc02c4..08a9c7b1 100644 --- a/lib/zitadel/client/models/user_service_auth_factor.rb +++ b/lib/zitadel/client/models/user_service_auth_factor.rb @@ -14,255 +14,99 @@ require 'time' module Zitadel::Client::Models - class UserServiceAuthFactor - attr_accessor :state - - attr_accessor :otp - - attr_accessor :u2f - - attr_accessor :otp_sms - - attr_accessor :otp_email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state', - :'otp' => :'otp', - :'u2f' => :'u2f', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'UserServiceAuthFactorState', - :'otp' => :'Object', - :'u2f' => :'UserServiceAuthFactorU2F', - :'otp_sms' => :'Object', - :'otp_email' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAuthFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAuthFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceAuthFactor + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Otp', + :'OtpEmail', + :'OtpSms', + :'U2f' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - else - self.state = 'AUTH_FACTOR_STATE_UNSPECIFIED' - end - - if attributes.key?(:'otp') - self.otp = attributes[:'otp'] - end - - if attributes.key?(:'u2f') - self.u2f = attributes[:'u2f'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] end - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state && - otp == o.otp && - u2f == o.u2f && - otp_sms == o.otp_sms && - otp_email == o.otp_email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state, otp, u2f, otp_sms, otp_email].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_type.rb b/lib/zitadel/client/models/user_service_auth_factors.rb similarity index 74% rename from lib/zitadel/client/models/user_service_type.rb rename to lib/zitadel/client/models/user_service_auth_factors.rb index 3810ec4b..de89236f 100644 --- a/lib/zitadel/client/models/user_service_type.rb +++ b/lib/zitadel/client/models/user_service_auth_factors.rb @@ -14,13 +14,14 @@ require 'time' module Zitadel::Client::Models - class UserServiceType - TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED".freeze - TYPE_HUMAN = "TYPE_HUMAN".freeze - TYPE_MACHINE = "TYPE_MACHINE".freeze + class UserServiceAuthFactors + OTP = "OTP".freeze + OTP_SMS = "OTP_SMS".freeze + OTP_EMAIL = "OTP_EMAIL".freeze + U2_F = "U2F".freeze def self.all_vars - @all_vars ||= [TYPE_UNSPECIFIED, TYPE_HUMAN, TYPE_MACHINE].freeze + @all_vars ||= [OTP, OTP_SMS, OTP_EMAIL, U2_F].freeze end # Builds the enum from string @@ -34,8 +35,8 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if UserServiceType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceType" + return value if UserServiceAuthFactors.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceAuthFactors" end end diff --git a/lib/zitadel/client/models/user_service_connect_error.rb b/lib/zitadel/client/models/user_service_connect_error.rb new file mode 100644 index 00000000..7db1ec76 --- /dev/null +++ b/lib/zitadel/client/models/user_service_connect_error.rb @@ -0,0 +1,285 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class UserServiceConnectError + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + attr_accessor :code + + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + attr_accessor :message + + attr_accessor :detail + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'detail' => :'detail' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'message' => :'String', + :'detail' => :'UserServiceAny' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceConnectError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + code_validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + return false unless code_validator.valid?(@code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] code Object to be assigned + def code=(code) + validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) + unless validator.valid?(code) + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." + end + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message, detail].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_create_invite_code_request.rb b/lib/zitadel/client/models/user_service_create_invite_code_request.rb index d691a4c2..647ce875 100644 --- a/lib/zitadel/client/models/user_service_create_invite_code_request.rb +++ b/lib/zitadel/client/models/user_service_create_invite_code_request.rb @@ -14,226 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceCreateInviteCodeRequest - attr_accessor :send_code - - attr_accessor :return_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'send_code' => :'sendCode', - :'return_code' => :'returnCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'send_code' => :'UserServiceSendInviteCode', - :'return_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceCreateInviteCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceCreateInviteCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceCreateInviteCodeRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode6', + :'SendCode4' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - send_code == o.send_code && - return_code == o.return_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [send_code, return_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_create_invite_code_response.rb b/lib/zitadel/client/models/user_service_create_invite_code_response.rb index 2ad90a73..e6b6d0a2 100644 --- a/lib/zitadel/client/models/user_service_create_invite_code_response.rb +++ b/lib/zitadel/client/models/user_service_create_invite_code_response.rb @@ -49,6 +49,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'invite_code' ]) end diff --git a/lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb b/lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb index 2db10461..f7635c9d 100644 --- a/lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb +++ b/lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb @@ -14,226 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceCreatePasskeyRegistrationLinkRequest - attr_accessor :send_link - - attr_accessor :return_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'send_link' => :'sendLink', - :'return_code' => :'returnCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'send_link' => :'UserServiceSendPasskeyRegistrationLink', - :'return_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceCreatePasskeyRegistrationLinkRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceCreatePasskeyRegistrationLinkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceCreatePasskeyRegistrationLinkRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode4', + :'SendLink' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'send_link') - self.send_link = attributes[:'send_link'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - send_link == o.send_link && - return_code == o.return_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [send_link, return_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_deactivate_user_request.rb b/lib/zitadel/client/models/user_service_deactivate_user_request.rb new file mode 100644 index 00000000..4920b7a4 --- /dev/null +++ b/lib/zitadel/client/models/user_service_deactivate_user_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceDeactivateUserRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDeactivateUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDeactivateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_in_user_emails_query.rb b/lib/zitadel/client/models/user_service_delete_user_request.rb similarity index 88% rename from lib/zitadel/client/models/user_service_in_user_emails_query.rb rename to lib/zitadel/client/models/user_service_delete_user_request.rb index a92f79de..ce7daaa7 100644 --- a/lib/zitadel/client/models/user_service_in_user_emails_query.rb +++ b/lib/zitadel/client/models/user_service_delete_user_request.rb @@ -14,15 +14,13 @@ require 'time' module Zitadel::Client::Models - # Query for users with email in list of emails. - class UserServiceInUserEmailsQuery - # the emails of the users to include - attr_accessor :user_emails + class UserServiceDeleteUserRequest + attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'user_emails' => :'userEmails' + :'user_id' => :'userId' } end @@ -39,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'user_emails' => :'Array' + :'user_id' => :'String' } end @@ -54,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceInUserEmailsQuery` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDeleteUserRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -62,15 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceInUserEmailsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDeleteUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'user_emails') - if (value = attributes[:'user_emails']).is_a?(Array) - self.user_emails = value - end + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil end end @@ -79,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -86,15 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - user_emails == o.user_emails + user_id == o.user_id end # @see the `==` method @@ -106,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [user_emails].hash + [user_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_details.rb b/lib/zitadel/client/models/user_service_details.rb index ac688016..6d22d584 100644 --- a/lib/zitadel/client/models/user_service_details.rb +++ b/lib/zitadel/client/models/user_service_details.rb @@ -15,14 +15,16 @@ module Zitadel::Client::Models class UserServiceDetails - # on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation attr_accessor :sequence - # on read: the timestamp of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :change_date + # resource_owner is the organization or instance_id an object belongs to attr_accessor :resource_owner + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :creation_date # Attribute mapping from ruby-style variable name to JSON key. @@ -48,7 +50,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'sequence' => :'String', + :'sequence' => :'Object', :'change_date' => :'Time', :'resource_owner' => :'String', :'creation_date' => :'Time' @@ -58,6 +60,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'sequence', ]) end diff --git a/lib/zitadel/client/models/web_key_service_rpc_status.rb b/lib/zitadel/client/models/user_service_domain_query.rb similarity index 88% rename from lib/zitadel/client/models/web_key_service_rpc_status.rb rename to lib/zitadel/client/models/user_service_domain_query.rb index dea0591d..0707114c 100644 --- a/lib/zitadel/client/models/web_key_service_rpc_status.rb +++ b/lib/zitadel/client/models/user_service_domain_query.rb @@ -14,19 +14,18 @@ require 'time' module Zitadel::Client::Models - class WebKeyServiceRpcStatus - attr_accessor :code + class UserServiceDomainQuery + # List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. + attr_accessor :include_without_domain - attr_accessor :message - - attr_accessor :details + # List only auth methods with specific domain. + attr_accessor :domain # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'include_without_domain' => :'includeWithoutDomain', + :'domain' => :'domain' } end @@ -43,9 +42,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'include_without_domain' => :'Boolean', + :'domain' => :'String' } end @@ -60,7 +58,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDomainQuery` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,23 +66,17 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDomainQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] + if attributes.key?(:'include_without_domain') + self.include_without_domain = attributes[:'include_without_domain'] end - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end + if attributes.key?(:'domain') + self.domain = attributes[:'domain'] end end @@ -108,9 +100,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + include_without_domain == o.include_without_domain && + domain == o.domain end # @see the `==` method @@ -122,7 +113,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [include_without_domain, domain].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_get_user_by_i_d_request.rb b/lib/zitadel/client/models/user_service_get_user_by_i_d_request.rb new file mode 100644 index 00000000..f945c729 --- /dev/null +++ b/lib/zitadel/client/models/user_service_get_user_by_i_d_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceGetUserByIDRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceGetUserByIDRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceGetUserByIDRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_hashed_password.rb b/lib/zitadel/client/models/user_service_hashed_password.rb index fc033983..c6dc3c69 100644 --- a/lib/zitadel/client/models/user_service_hashed_password.rb +++ b/lib/zitadel/client/models/user_service_hashed_password.rb @@ -15,7 +15,6 @@ module Zitadel::Client::Models class UserServiceHashedPassword - # \"Encoded hash of a password in Modular Crypt Format: https://zitadel.com/docs/concepts/architecture/secrets#hashed-secrets\" attr_accessor :hash attr_accessor :change_required @@ -90,14 +89,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "hash", hash cannot be nil.') end - if @hash.to_s.length > 200 - invalid_properties.push('invalid value for "hash", the character length must be smaller than or equal to 200.') - end - - if @hash.to_s.length < 1 - invalid_properties.push('invalid value for "hash", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -106,26 +97,16 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @hash.nil? - return false if @hash.to_s.length > 200 - return false if @hash.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] hash Value to be assigned + # @param [String] hash Value to be assigned def hash=(hash) if hash.nil? fail ArgumentError, 'hash cannot be nil' end - if hash.to_s.length > 200 - fail ArgumentError, 'invalid value for "hash", the character length must be smaller than or equal to 200.' - end - - if hash.to_s.length < 1 - fail ArgumentError, 'invalid value for "hash", the character length must be great than or equal to 1.' - end - @hash = hash end diff --git a/lib/zitadel/client/models/user_service_human_email.rb b/lib/zitadel/client/models/user_service_human_email.rb index 5c088847..fb24fb28 100644 --- a/lib/zitadel/client/models/user_service_human_email.rb +++ b/lib/zitadel/client/models/user_service_human_email.rb @@ -83,14 +83,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@email.nil? && @email.to_s.length > 200 - invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 200.') - end - - if !@email.nil? && @email.to_s.length < 1 - invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -98,29 +90,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@email.nil? && @email.to_s.length > 200 - return false if !@email.nil? && @email.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] email Value to be assigned - def email=(email) - if email.nil? - fail ArgumentError, 'email cannot be nil' - end - - if email.to_s.length > 200 - fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 200.' - end - - if email.to_s.length < 1 - fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' - end - - @email = email - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/action_service_beta_update_target_response.rb b/lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_request.rb similarity index 87% rename from lib/zitadel/client/models/action_service_beta_update_target_response.rb rename to lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_request.rb index 5d92e82d..ac3d1b4f 100644 --- a/lib/zitadel/client/models/action_service_beta_update_target_response.rb +++ b/lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_request.rb @@ -14,18 +14,13 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaUpdateTargetResponse - # The timestamp of the change of the target. - attr_accessor :change_date - - # Key used to sign and check payload sent to the target. - attr_accessor :signing_key + class UserServiceHumanMFAInitSkippedRequest + attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'change_date' => :'changeDate', - :'signing_key' => :'signingKey' + :'user_id' => :'userId' } end @@ -42,8 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'change_date' => :'Time', - :'signing_key' => :'String' + :'user_id' => :'String' } end @@ -58,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaUpdateTargetResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHumanMFAInitSkippedRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -66,17 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaUpdateTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHumanMFAInitSkippedRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'signing_key') - self.signing_key = attributes[:'signing_key'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil end end @@ -85,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -92,16 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - change_date == o.change_date && - signing_key == o.signing_key + user_id == o.user_id end # @see the `==` method @@ -113,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [change_date, signing_key].hash + [user_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_human_phone.rb b/lib/zitadel/client/models/user_service_human_phone.rb index 0c4a4acc..07338585 100644 --- a/lib/zitadel/client/models/user_service_human_phone.rb +++ b/lib/zitadel/client/models/user_service_human_phone.rb @@ -83,10 +83,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@phone.nil? && @phone.to_s.length > 200 - invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 200.') - end - invalid_properties end @@ -94,24 +90,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@phone.nil? && @phone.to_s.length > 200 true end - # Custom attribute writer method with validation - # @param [Object] phone Value to be assigned - def phone=(phone) - if phone.nil? - fail ArgumentError, 'phone cannot be nil' - end - - if phone.to_s.length > 200 - fail ArgumentError, 'invalid value for "phone", the character length must be smaller than or equal to 200.' - end - - @phone = phone - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/user_service_human_profile.rb b/lib/zitadel/client/models/user_service_human_profile.rb index 072c9b81..e7d8eca4 100644 --- a/lib/zitadel/client/models/user_service_human_profile.rb +++ b/lib/zitadel/client/models/user_service_human_profile.rb @@ -27,7 +27,6 @@ class UserServiceHumanProfile attr_accessor :gender - # avatar URL of the user attr_accessor :avatar_url class EnumAttributeValidator @@ -91,6 +90,9 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'nick_name', + :'display_name', + :'preferred_language', ]) end @@ -134,8 +136,6 @@ def initialize(attributes = {}) if attributes.key?(:'gender') self.gender = attributes[:'gender'] - else - self.gender = 'GENDER_UNSPECIFIED' end if attributes.key?(:'avatar_url') @@ -148,34 +148,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@given_name.nil? && @given_name.to_s.length > 200 - invalid_properties.push('invalid value for "given_name", the character length must be smaller than or equal to 200.') - end - - if !@given_name.nil? && @given_name.to_s.length < 1 - invalid_properties.push('invalid value for "given_name", the character length must be great than or equal to 1.') - end - - if !@family_name.nil? && @family_name.to_s.length > 200 - invalid_properties.push('invalid value for "family_name", the character length must be smaller than or equal to 200.') - end - - if !@family_name.nil? && @family_name.to_s.length < 1 - invalid_properties.push('invalid value for "family_name", the character length must be great than or equal to 1.') - end - - if !@nick_name.nil? && @nick_name.to_s.length > 200 - invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 200.') - end - - if !@display_name.nil? && @display_name.to_s.length > 200 - invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 200.') - end - - if !@preferred_language.nil? && @preferred_language.to_s.length > 10 - invalid_properties.push('invalid value for "preferred_language", the character length must be smaller than or equal to 10.') - end - invalid_properties end @@ -183,94 +155,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@given_name.nil? && @given_name.to_s.length > 200 - return false if !@given_name.nil? && @given_name.to_s.length < 1 - return false if !@family_name.nil? && @family_name.to_s.length > 200 - return false if !@family_name.nil? && @family_name.to_s.length < 1 - return false if !@nick_name.nil? && @nick_name.to_s.length > 200 - return false if !@display_name.nil? && @display_name.to_s.length > 200 - return false if !@preferred_language.nil? && @preferred_language.to_s.length > 10 true end - # Custom attribute writer method with validation - # @param [Object] given_name Value to be assigned - def given_name=(given_name) - if given_name.nil? - fail ArgumentError, 'given_name cannot be nil' - end - - if given_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "given_name", the character length must be smaller than or equal to 200.' - end - - if given_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "given_name", the character length must be great than or equal to 1.' - end - - @given_name = given_name - end - - # Custom attribute writer method with validation - # @param [Object] family_name Value to be assigned - def family_name=(family_name) - if family_name.nil? - fail ArgumentError, 'family_name cannot be nil' - end - - if family_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "family_name", the character length must be smaller than or equal to 200.' - end - - if family_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "family_name", the character length must be great than or equal to 1.' - end - - @family_name = family_name - end - - # Custom attribute writer method with validation - # @param [Object] nick_name Value to be assigned - def nick_name=(nick_name) - if nick_name.nil? - fail ArgumentError, 'nick_name cannot be nil' - end - - if nick_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 200.' - end - - @nick_name = nick_name - end - - # Custom attribute writer method with validation - # @param [Object] display_name Value to be assigned - def display_name=(display_name) - if display_name.nil? - fail ArgumentError, 'display_name cannot be nil' - end - - if display_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 200.' - end - - @display_name = display_name - end - - # Custom attribute writer method with validation - # @param [Object] preferred_language Value to be assigned - def preferred_language=(preferred_language) - if preferred_language.nil? - fail ArgumentError, 'preferred_language cannot be nil' - end - - if preferred_language.to_s.length > 10 - fail ArgumentError, 'invalid value for "preferred_language", the character length must be smaller than or equal to 10.' - end - - @preferred_language = preferred_language - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/user_service_human_user.rb b/lib/zitadel/client/models/user_service_human_user.rb index d9e3a8b0..583face4 100644 --- a/lib/zitadel/client/models/user_service_human_user.rb +++ b/lib/zitadel/client/models/user_service_human_user.rb @@ -38,10 +38,10 @@ class UserServiceHumanUser # User is required to change the used password on the next login. attr_accessor :password_change_required - # The time the user last changed their password. + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :password_changed - # The time the user last skipped MFA initialization. + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :mfa_init_skipped class EnumAttributeValidator @@ -140,8 +140,6 @@ def initialize(attributes = {}) if attributes.key?(:'state') self.state = attributes[:'state'] - else - self.state = 'USER_STATE_UNSPECIFIED' end if attributes.key?(:'username') diff --git a/lib/zitadel/client/models/user_service_i_d_p_intent.rb b/lib/zitadel/client/models/user_service_i_d_p_intent.rb deleted file mode 100644 index 74b4ecf9..00000000 --- a/lib/zitadel/client/models/user_service_i_d_p_intent.rb +++ /dev/null @@ -1,326 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceIDPIntent - # ID of the IDP intent - attr_accessor :idp_intent_id - - # token of the IDP intent - attr_accessor :idp_intent_token - - # ID of the ZITADEL user if external user already linked - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_intent_id' => :'idpIntentId', - :'idp_intent_token' => :'idpIntentToken', - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_intent_id' => :'String', - :'idp_intent_token' => :'String', - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPIntent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPIntent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_intent_id') - self.idp_intent_id = attributes[:'idp_intent_id'] - end - - if attributes.key?(:'idp_intent_token') - self.idp_intent_token = attributes[:'idp_intent_token'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@idp_intent_id.nil? && @idp_intent_id.to_s.length > 200 - invalid_properties.push('invalid value for "idp_intent_id", the character length must be smaller than or equal to 200.') - end - - if !@idp_intent_id.nil? && @idp_intent_id.to_s.length < 1 - invalid_properties.push('invalid value for "idp_intent_id", the character length must be great than or equal to 1.') - end - - if !@idp_intent_token.nil? && @idp_intent_token.to_s.length > 200 - invalid_properties.push('invalid value for "idp_intent_token", the character length must be smaller than or equal to 200.') - end - - if !@idp_intent_token.nil? && @idp_intent_token.to_s.length < 1 - invalid_properties.push('invalid value for "idp_intent_token", the character length must be great than or equal to 1.') - end - - if !@user_id.nil? && @user_id.to_s.length > 200 - invalid_properties.push('invalid value for "user_id", the character length must be smaller than or equal to 200.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@idp_intent_id.nil? && @idp_intent_id.to_s.length > 200 - return false if !@idp_intent_id.nil? && @idp_intent_id.to_s.length < 1 - return false if !@idp_intent_token.nil? && @idp_intent_token.to_s.length > 200 - return false if !@idp_intent_token.nil? && @idp_intent_token.to_s.length < 1 - return false if !@user_id.nil? && @user_id.to_s.length > 200 - true - end - - # Custom attribute writer method with validation - # @param [Object] idp_intent_id Value to be assigned - def idp_intent_id=(idp_intent_id) - if idp_intent_id.nil? - fail ArgumentError, 'idp_intent_id cannot be nil' - end - - if idp_intent_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "idp_intent_id", the character length must be smaller than or equal to 200.' - end - - if idp_intent_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "idp_intent_id", the character length must be great than or equal to 1.' - end - - @idp_intent_id = idp_intent_id - end - - # Custom attribute writer method with validation - # @param [Object] idp_intent_token Value to be assigned - def idp_intent_token=(idp_intent_token) - if idp_intent_token.nil? - fail ArgumentError, 'idp_intent_token cannot be nil' - end - - if idp_intent_token.to_s.length > 200 - fail ArgumentError, 'invalid value for "idp_intent_token", the character length must be smaller than or equal to 200.' - end - - if idp_intent_token.to_s.length < 1 - fail ArgumentError, 'invalid value for "idp_intent_token", the character length must be great than or equal to 1.' - end - - @idp_intent_token = idp_intent_token - end - - # Custom attribute writer method with validation - # @param [Object] user_id Value to be assigned - def user_id=(user_id) - if user_id.nil? - fail ArgumentError, 'user_id cannot be nil' - end - - if user_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_id", the character length must be smaller than or equal to 200.' - end - - @user_id = user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_intent_id == o.idp_intent_id && - idp_intent_token == o.idp_intent_token && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_intent_id, idp_intent_token, user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_i_d_p_link.rb b/lib/zitadel/client/models/user_service_i_d_p_link.rb index 5bc754ed..862ba7b0 100644 --- a/lib/zitadel/client/models/user_service_i_d_p_link.rb +++ b/lib/zitadel/client/models/user_service_i_d_p_link.rb @@ -15,13 +15,10 @@ module Zitadel::Client::Models class UserServiceIDPLink - # ID of the identity provider attr_accessor :idp_id - # ID of the user of the identity provider attr_accessor :user_id - # username of the user of the identity provider attr_accessor :user_name # Attribute mapping from ruby-style variable name to JSON key. @@ -94,30 +91,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@idp_id.nil? && @idp_id.to_s.length > 200 - invalid_properties.push('invalid value for "idp_id", the character length must be smaller than or equal to 200.') - end - - if !@idp_id.nil? && @idp_id.to_s.length < 1 - invalid_properties.push('invalid value for "idp_id", the character length must be great than or equal to 1.') - end - - if !@user_id.nil? && @user_id.to_s.length > 200 - invalid_properties.push('invalid value for "user_id", the character length must be smaller than or equal to 200.') - end - - if !@user_id.nil? && @user_id.to_s.length < 1 - invalid_properties.push('invalid value for "user_id", the character length must be great than or equal to 1.') - end - - if !@user_name.nil? && @user_name.to_s.length > 200 - invalid_properties.push('invalid value for "user_name", the character length must be smaller than or equal to 200.') - end - - if !@user_name.nil? && @user_name.to_s.length < 1 - invalid_properties.push('invalid value for "user_name", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -125,69 +98,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@idp_id.nil? && @idp_id.to_s.length > 200 - return false if !@idp_id.nil? && @idp_id.to_s.length < 1 - return false if !@user_id.nil? && @user_id.to_s.length > 200 - return false if !@user_id.nil? && @user_id.to_s.length < 1 - return false if !@user_name.nil? && @user_name.to_s.length > 200 - return false if !@user_name.nil? && @user_name.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] idp_id Value to be assigned - def idp_id=(idp_id) - if idp_id.nil? - fail ArgumentError, 'idp_id cannot be nil' - end - - if idp_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "idp_id", the character length must be smaller than or equal to 200.' - end - - if idp_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "idp_id", the character length must be great than or equal to 1.' - end - - @idp_id = idp_id - end - - # Custom attribute writer method with validation - # @param [Object] user_id Value to be assigned - def user_id=(user_id) - if user_id.nil? - fail ArgumentError, 'user_id cannot be nil' - end - - if user_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_id", the character length must be smaller than or equal to 200.' - end - - if user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "user_id", the character length must be great than or equal to 1.' - end - - @user_id = user_id - end - - # Custom attribute writer method with validation - # @param [Object] user_name Value to be assigned - def user_name=(user_name) - if user_name.nil? - fail ArgumentError, 'user_name cannot be nil' - end - - if user_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_name", the character length must be smaller than or equal to 200.' - end - - if user_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "user_name", the character length must be great than or equal to 1.' - end - - @user_name = user_name - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/user_service_idp_information.rb b/lib/zitadel/client/models/user_service_idp_information.rb new file mode 100644 index 00000000..8eaec826 --- /dev/null +++ b/lib/zitadel/client/models/user_service_idp_information.rb @@ -0,0 +1,111 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +module UserServiceIDPInformation + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Ldap2', + :'Oauth1', + :'Saml1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/user_service_last_name_query.rb b/lib/zitadel/client/models/user_service_last_name_query.rb deleted file mode 100644 index cc86a387..00000000 --- a/lib/zitadel/client/models/user_service_last_name_query.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Query for users with a specific last name. - class UserServiceLastNameQuery - attr_accessor :last_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'last_name' => :'lastName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'last_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLastNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLastNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - else - self.last_name = nil - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_QUERY_METHOD_EQUALS' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @last_name.nil? - invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') - end - - if @last_name.to_s.length > 200 - invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 200.') - end - - if @last_name.to_s.length < 1 - invalid_properties.push('invalid value for "last_name", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @last_name.nil? - return false if @last_name.to_s.length > 200 - return false if @last_name.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] last_name Value to be assigned - def last_name=(last_name) - if last_name.nil? - fail ArgumentError, 'last_name cannot be nil' - end - - if last_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 200.' - end - - if last_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "last_name", the character length must be great than or equal to 1.' - end - - @last_name = last_name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - last_name == o.last_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [last_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_list_authentication_factors_request.rb b/lib/zitadel/client/models/user_service_list_authentication_factors_request.rb new file mode 100644 index 00000000..0335b047 --- /dev/null +++ b/lib/zitadel/client/models/user_service_list_authentication_factors_request.rb @@ -0,0 +1,269 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceListAuthenticationFactorsRequest + attr_accessor :user_id + + attr_accessor :auth_factors + + attr_accessor :states + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'auth_factors' => :'authFactors', + :'states' => :'states' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'auth_factors' => :'Array', + :'states' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListAuthenticationFactorsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListAuthenticationFactorsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'auth_factors') + if (value = attributes[:'auth_factors']).is_a?(Array) + self.auth_factors = value + end + end + + if attributes.key?(:'states') + if (value = attributes[:'states']).is_a?(Array) + self.states = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + auth_factors == o.auth_factors && + states == o.states + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, auth_factors, states].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_list_authentication_method_types_request.rb b/lib/zitadel/client/models/user_service_list_authentication_method_types_request.rb new file mode 100644 index 00000000..db5c994a --- /dev/null +++ b/lib/zitadel/client/models/user_service_list_authentication_method_types_request.rb @@ -0,0 +1,256 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceListAuthenticationMethodTypesRequest + attr_accessor :user_id + + attr_accessor :domain_query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'domain_query' => :'domainQuery' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'domain_query' => :'UserServiceDomainQuery' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListAuthenticationMethodTypesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListAuthenticationMethodTypesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'domain_query') + self.domain_query = attributes[:'domain_query'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + domain_query == o.domain_query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, domain_query].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_list_details.rb b/lib/zitadel/client/models/user_service_list_details.rb index c2424933..613b6003 100644 --- a/lib/zitadel/client/models/user_service_list_details.rb +++ b/lib/zitadel/client/models/user_service_list_details.rb @@ -19,7 +19,7 @@ class UserServiceListDetails attr_accessor :processed_sequence - # the last time the projection got updated + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. attr_accessor :timestamp # Attribute mapping from ruby-style variable name to JSON key. @@ -44,8 +44,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'total_result' => :'String', - :'processed_sequence' => :'String', + :'total_result' => :'Object', + :'processed_sequence' => :'Object', :'timestamp' => :'Time' } end @@ -53,6 +53,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'total_result', + :'processed_sequence', ]) end diff --git a/lib/zitadel/client/models/user_service_list_i_d_p_links_request.rb b/lib/zitadel/client/models/user_service_list_i_d_p_links_request.rb index 44cb5210..9e72cc65 100644 --- a/lib/zitadel/client/models/user_service_list_i_d_p_links_request.rb +++ b/lib/zitadel/client/models/user_service_list_i_d_p_links_request.rb @@ -15,11 +15,14 @@ module Zitadel::Client::Models class UserServiceListIDPLinksRequest + attr_accessor :user_id + attr_accessor :query # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'query' => :'query' } end @@ -37,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'query' => :'UserServiceListQuery' } end @@ -65,6 +69,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + if attributes.key?(:'query') self.query = attributes[:'query'] end @@ -90,6 +98,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && query == o.query end @@ -102,7 +111,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [query].hash + [user_id, query].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_list_passkeys_request.rb b/lib/zitadel/client/models/user_service_list_passkeys_request.rb new file mode 100644 index 00000000..29e2e6e7 --- /dev/null +++ b/lib/zitadel/client/models/user_service_list_passkeys_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceListPasskeysRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListPasskeysRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListPasskeysRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_list_query.rb b/lib/zitadel/client/models/user_service_list_query.rb index 3484fe15..82bd15df 100644 --- a/lib/zitadel/client/models/user_service_list_query.rb +++ b/lib/zitadel/client/models/user_service_list_query.rb @@ -14,14 +14,11 @@ require 'time' module Zitadel::Client::Models - # Object unspecific list filters like offset, limit and asc/desc. class UserServiceListQuery attr_accessor :offset - # Maximum amount of events returned. The default is set to 1000 in https://github.com/zitadel/zitadel/blob/new-eventstore/cmd/zitadel/startup.yaml. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. attr_accessor :limit - # default is descending attr_accessor :asc # Attribute mapping from ruby-style variable name to JSON key. @@ -46,7 +43,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'offset' => :'String', + :'offset' => :'Object', :'limit' => :'Integer', :'asc' => :'Boolean' } @@ -55,6 +52,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'offset', ]) end diff --git a/lib/zitadel/client/models/user_service_list_users_request.rb b/lib/zitadel/client/models/user_service_list_users_request.rb index ab8aa922..038589cd 100644 --- a/lib/zitadel/client/models/user_service_list_users_request.rb +++ b/lib/zitadel/client/models/user_service_list_users_request.rb @@ -19,6 +19,7 @@ class UserServiceListUsersRequest attr_accessor :sorting_column + # criteria the client is looking for attr_accessor :queries class EnumAttributeValidator @@ -101,8 +102,6 @@ def initialize(attributes = {}) if attributes.key?(:'sorting_column') self.sorting_column = attributes[:'sorting_column'] - else - self.sorting_column = 'USER_FIELD_NAME_UNSPECIFIED' end if attributes.key?(:'queries') diff --git a/lib/zitadel/client/models/user_service_list_users_response.rb b/lib/zitadel/client/models/user_service_list_users_response.rb index 04bf87fb..583920bd 100644 --- a/lib/zitadel/client/models/user_service_list_users_response.rb +++ b/lib/zitadel/client/models/user_service_list_users_response.rb @@ -101,8 +101,6 @@ def initialize(attributes = {}) if attributes.key?(:'sorting_column') self.sorting_column = attributes[:'sorting_column'] - else - self.sorting_column = 'USER_FIELD_NAME_UNSPECIFIED' end if attributes.key?(:'result') diff --git a/lib/zitadel/client/models/user_service_lock_user_request.rb b/lib/zitadel/client/models/user_service_lock_user_request.rb new file mode 100644 index 00000000..a3b11ddf --- /dev/null +++ b/lib/zitadel/client/models/user_service_lock_user_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceLockUserRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLockUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLockUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_machine_user.rb b/lib/zitadel/client/models/user_service_machine_user.rb index 84a9c87c..d5a9e2f6 100644 --- a/lib/zitadel/client/models/user_service_machine_user.rb +++ b/lib/zitadel/client/models/user_service_machine_user.rb @@ -113,8 +113,6 @@ def initialize(attributes = {}) if attributes.key?(:'access_token_type') self.access_token_type = attributes[:'access_token_type'] - else - self.access_token_type = 'ACCESS_TOKEN_TYPE_BEARER' end end diff --git a/lib/zitadel/client/models/user_service_organization.rb b/lib/zitadel/client/models/user_service_organization.rb index bc6dc577..2b11f482 100644 --- a/lib/zitadel/client/models/user_service_organization.rb +++ b/lib/zitadel/client/models/user_service_organization.rb @@ -14,226 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceOrganization - attr_accessor :org_id - - attr_accessor :org_domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'org_id' => :'orgId', - :'org_domain' => :'orgDomain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'org_id' => :'String', - :'org_domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceOrganization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceOrganization + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'OrgDomain', + :'OrgId' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - - if attributes.key?(:'org_domain') - self.org_domain = attributes[:'org_domain'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - org_id == o.org_id && - org_domain == o.org_domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [org_id, org_domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_passkey.rb b/lib/zitadel/client/models/user_service_passkey.rb index 9e720f1b..0648eb1e 100644 --- a/lib/zitadel/client/models/user_service_passkey.rb +++ b/lib/zitadel/client/models/user_service_passkey.rb @@ -101,8 +101,6 @@ def initialize(attributes = {}) if attributes.key?(:'state') self.state = attributes[:'state'] - else - self.state = 'AUTH_FACTOR_STATE_UNSPECIFIED' end if attributes.key?(:'name') @@ -115,14 +113,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@name.nil? && @name.to_s.length > 200 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.') - end - - if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -130,29 +120,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@name.nil? && @name.to_s.length > 200 - return false if !@name.nil? && @name.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length > 200 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - @name = name - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/user_service_passkey_registration_code.rb b/lib/zitadel/client/models/user_service_passkey_registration_code.rb index 8947e2f7..a1a2a20d 100644 --- a/lib/zitadel/client/models/user_service_passkey_registration_code.rb +++ b/lib/zitadel/client/models/user_service_passkey_registration_code.rb @@ -15,10 +15,8 @@ module Zitadel::Client::Models class UserServicePasskeyRegistrationCode - # \"id to the one time code generated by ZITADEL\" attr_accessor :id - # \"one time code generated by ZITADEL\" attr_accessor :code # Attribute mapping from ruby-style variable name to JSON key. @@ -93,18 +91,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "id", id cannot be nil.') end - if @id.to_s.length > 200 - invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 200.') - end - if @code.nil? invalid_properties.push('invalid value for "code", code cannot be nil.') end - if @code.to_s.length > 200 - invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 200.') - end - invalid_properties end @@ -113,37 +103,27 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? - return false if @id.to_s.length > 200 return false if @code.nil? - return false if @code.to_s.length > 200 true end # Custom attribute writer method with validation - # @param [Object] id Value to be assigned + # @param [String] id Value to be assigned def id=(id) if id.nil? fail ArgumentError, 'id cannot be nil' end - if id.to_s.length > 200 - fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 200.' - end - @id = id end # Custom attribute writer method with validation - # @param [Object] code Value to be assigned + # @param [String] code Value to be assigned def code=(code) if code.nil? fail ArgumentError, 'code cannot be nil' end - if code.to_s.length > 200 - fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 200.' - end - @code = code end diff --git a/lib/zitadel/client/models/user_service_password.rb b/lib/zitadel/client/models/user_service_password.rb index cea82b92..c5d8527d 100644 --- a/lib/zitadel/client/models/user_service_password.rb +++ b/lib/zitadel/client/models/user_service_password.rb @@ -89,14 +89,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "password", password cannot be nil.') end - if @password.to_s.length > 200 - invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 200.') - end - - if @password.to_s.length < 1 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -105,26 +97,16 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @password.nil? - return false if @password.to_s.length > 200 - return false if @password.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] password Value to be assigned + # @param [String] password Value to be assigned def password=(password) if password.nil? fail ArgumentError, 'password cannot be nil' end - if password.to_s.length > 200 - fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 200.' - end - - if password.to_s.length < 1 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.' - end - @password = password end diff --git a/lib/zitadel/client/models/user_service_password_reset_request.rb b/lib/zitadel/client/models/user_service_password_reset_request.rb index cc87ec38..23c5ad8e 100644 --- a/lib/zitadel/client/models/user_service_password_reset_request.rb +++ b/lib/zitadel/client/models/user_service_password_reset_request.rb @@ -14,226 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServicePasswordResetRequest - attr_accessor :send_link - - attr_accessor :return_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'send_link' => :'sendLink', - :'return_code' => :'returnCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'send_link' => :'UserServiceSendPasswordResetLink', - :'return_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePasswordResetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePasswordResetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServicePasswordResetRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode5', + :'SendLink1' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'send_link') - self.send_link = attributes[:'send_link'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - send_link == o.send_link && - return_code == o.return_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [send_link, return_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_password_reset_response.rb b/lib/zitadel/client/models/user_service_password_reset_response.rb index c314793e..6501271d 100644 --- a/lib/zitadel/client/models/user_service_password_reset_response.rb +++ b/lib/zitadel/client/models/user_service_password_reset_response.rb @@ -17,6 +17,7 @@ module Zitadel::Client::Models class UserServicePasswordResetResponse attr_accessor :details + # in case the medium was set to return_code, the code will be returned attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. @@ -48,6 +49,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'verification_code' ]) end diff --git a/lib/zitadel/client/models/user_service_phone_query.rb b/lib/zitadel/client/models/user_service_phone_query.rb deleted file mode 100644 index 01c9f1b4..00000000 --- a/lib/zitadel/client/models/user_service_phone_query.rb +++ /dev/null @@ -1,300 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Query for users with a specific phone. - class UserServicePhoneQuery - # Phone number of the user - attr_accessor :number - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'number' => :'number', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'number' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePhoneQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePhoneQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'number') - self.number = attributes[:'number'] - else - self.number = nil - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_QUERY_METHOD_EQUALS' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @number.nil? - invalid_properties.push('invalid value for "number", number cannot be nil.') - end - - if @number.to_s.length > 20 - invalid_properties.push('invalid value for "number", the character length must be smaller than or equal to 20.') - end - - if @number.to_s.length < 1 - invalid_properties.push('invalid value for "number", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @number.nil? - return false if @number.to_s.length > 20 - return false if @number.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] number Value to be assigned - def number=(number) - if number.nil? - fail ArgumentError, 'number cannot be nil' - end - - if number.to_s.length > 20 - fail ArgumentError, 'invalid value for "number", the character length must be smaller than or equal to 20.' - end - - if number.to_s.length < 1 - fail ArgumentError, 'invalid value for "number", the character length must be great than or equal to 1.' - end - - @number = number - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - number == o.number && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [number, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_reactivate_user_request.rb b/lib/zitadel/client/models/user_service_reactivate_user_request.rb new file mode 100644 index 00000000..1e20c4d2 --- /dev/null +++ b/lib/zitadel/client/models/user_service_reactivate_user_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceReactivateUserRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceReactivateUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceReactivateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_redirect_u_r_ls.rb b/lib/zitadel/client/models/user_service_redirect_u_r_ls.rb deleted file mode 100644 index b735baac..00000000 --- a/lib/zitadel/client/models/user_service_redirect_u_r_ls.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRedirectURLs - # URL on which the user will be redirected after a successful login - attr_accessor :success_url - - # URL on which the user will be redirected after a failed login - attr_accessor :failure_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'success_url' => :'successUrl', - :'failure_url' => :'failureUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'success_url' => :'String', - :'failure_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRedirectURLs` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRedirectURLs`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'success_url') - self.success_url = attributes[:'success_url'] - end - - if attributes.key?(:'failure_url') - self.failure_url = attributes[:'failure_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@success_url.nil? && @success_url.to_s.length > 2048 - invalid_properties.push('invalid value for "success_url", the character length must be smaller than or equal to 2048.') - end - - if !@success_url.nil? && @success_url.to_s.length < 1 - invalid_properties.push('invalid value for "success_url", the character length must be great than or equal to 1.') - end - - if !@failure_url.nil? && @failure_url.to_s.length > 2048 - invalid_properties.push('invalid value for "failure_url", the character length must be smaller than or equal to 2048.') - end - - if !@failure_url.nil? && @failure_url.to_s.length < 1 - invalid_properties.push('invalid value for "failure_url", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@success_url.nil? && @success_url.to_s.length > 2048 - return false if !@success_url.nil? && @success_url.to_s.length < 1 - return false if !@failure_url.nil? && @failure_url.to_s.length > 2048 - return false if !@failure_url.nil? && @failure_url.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] success_url Value to be assigned - def success_url=(success_url) - if success_url.nil? - fail ArgumentError, 'success_url cannot be nil' - end - - if success_url.to_s.length > 2048 - fail ArgumentError, 'invalid value for "success_url", the character length must be smaller than or equal to 2048.' - end - - if success_url.to_s.length < 1 - fail ArgumentError, 'invalid value for "success_url", the character length must be great than or equal to 1.' - end - - @success_url = success_url - end - - # Custom attribute writer method with validation - # @param [Object] failure_url Value to be assigned - def failure_url=(failure_url) - if failure_url.nil? - fail ArgumentError, 'failure_url cannot be nil' - end - - if failure_url.to_s.length > 2048 - fail ArgumentError, 'invalid value for "failure_url", the character length must be smaller than or equal to 2048.' - end - - if failure_url.to_s.length < 1 - fail ArgumentError, 'invalid value for "failure_url", the character length must be great than or equal to 1.' - end - - @failure_url = failure_url - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - success_url == o.success_url && - failure_url == o.failure_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [success_url, failure_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_register_passkey_request.rb b/lib/zitadel/client/models/user_service_register_passkey_request.rb index 9989822d..716891d3 100644 --- a/lib/zitadel/client/models/user_service_register_passkey_request.rb +++ b/lib/zitadel/client/models/user_service_register_passkey_request.rb @@ -15,11 +15,12 @@ module Zitadel::Client::Models class UserServiceRegisterPasskeyRequest + attr_accessor :user_id + attr_accessor :code attr_accessor :authenticator - # \"Domain on which the user is authenticated.\" attr_accessor :domain class EnumAttributeValidator @@ -47,6 +48,7 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'code' => :'code', :'authenticator' => :'authenticator', :'domain' => :'domain' @@ -66,6 +68,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'code' => :'UserServicePasskeyRegistrationCode', :'authenticator' => :'UserServicePasskeyAuthenticator', :'domain' => :'String' @@ -96,14 +99,18 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + if attributes.key?(:'code') self.code = attributes[:'code'] end if attributes.key?(:'authenticator') self.authenticator = attributes[:'authenticator'] - else - self.authenticator = 'PASSKEY_AUTHENTICATOR_UNSPECIFIED' end if attributes.key?(:'domain') @@ -116,6 +123,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -123,14 +134,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && code == o.code && authenticator == o.authenticator && domain == o.domain @@ -145,7 +168,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, authenticator, domain].hash + [user_id, code, authenticator, domain].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_register_passkey_response.rb b/lib/zitadel/client/models/user_service_register_passkey_response.rb index cf29deb4..fc525b4c 100644 --- a/lib/zitadel/client/models/user_service_register_passkey_response.rb +++ b/lib/zitadel/client/models/user_service_register_passkey_response.rb @@ -19,7 +19,7 @@ class UserServiceRegisterPasskeyResponse attr_accessor :passkey_id - # Options for Credential Creation (dictionary PublicKeyCredentialCreationOptions). Generated helper methods transform the field to JSON, for use in a WebauthN client. See also: https://www.w3.org/TR/webauthn/#dictdef-publickeycredentialcreationoptions + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. attr_accessor :public_key_credential_creation_options # Attribute mapping from ruby-style variable name to JSON key. @@ -46,7 +46,7 @@ def self.openapi_types { :'details' => :'UserServiceDetails', :'passkey_id' => :'String', - :'public_key_credential_creation_options' => :'Object' + :'public_key_credential_creation_options' => :'Hash' } end @@ -83,7 +83,9 @@ def initialize(attributes = {}) end if attributes.key?(:'public_key_credential_creation_options') - self.public_key_credential_creation_options = attributes[:'public_key_credential_creation_options'] + if (value = attributes[:'public_key_credential_creation_options']).is_a?(Hash) + self.public_key_credential_creation_options = value + end end end diff --git a/lib/zitadel/client/models/user_service_register_t_o_t_p_request.rb b/lib/zitadel/client/models/user_service_register_t_o_t_p_request.rb new file mode 100644 index 00000000..81e45b8c --- /dev/null +++ b/lib/zitadel/client/models/user_service_register_t_o_t_p_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceRegisterTOTPRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRegisterTOTPRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRegisterTOTPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_register_u2_f_request.rb b/lib/zitadel/client/models/user_service_register_u2_f_request.rb index 6f4da41f..306dbe32 100644 --- a/lib/zitadel/client/models/user_service_register_u2_f_request.rb +++ b/lib/zitadel/client/models/user_service_register_u2_f_request.rb @@ -15,12 +15,14 @@ module Zitadel::Client::Models class UserServiceRegisterU2FRequest - # \"Domain on which the user is authenticated.\" + attr_accessor :user_id + attr_accessor :domain # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'domain' => :'domain' } end @@ -38,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'domain' => :'String' } end @@ -66,6 +69,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end @@ -76,6 +85,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -83,14 +96,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && domain == o.domain end @@ -103,7 +128,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [domain].hash + [user_id, domain].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_register_u2_f_response.rb b/lib/zitadel/client/models/user_service_register_u2_f_response.rb index 57637f21..44c5d7d0 100644 --- a/lib/zitadel/client/models/user_service_register_u2_f_response.rb +++ b/lib/zitadel/client/models/user_service_register_u2_f_response.rb @@ -19,7 +19,7 @@ class UserServiceRegisterU2FResponse attr_accessor :u2f_id - # Options for Credential Creation (dictionary PublicKeyCredentialCreationOptions). Generated helper methods transform the field to JSON, for use in a WebauthN client. See also: https://www.w3.org/TR/webauthn/#dictdef-publickeycredentialcreationoptions + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. attr_accessor :public_key_credential_creation_options # Attribute mapping from ruby-style variable name to JSON key. @@ -46,7 +46,7 @@ def self.openapi_types { :'details' => :'UserServiceDetails', :'u2f_id' => :'String', - :'public_key_credential_creation_options' => :'Object' + :'public_key_credential_creation_options' => :'Hash' } end @@ -83,7 +83,9 @@ def initialize(attributes = {}) end if attributes.key?(:'public_key_credential_creation_options') - self.public_key_credential_creation_options = attributes[:'public_key_credential_creation_options'] + if (value = attributes[:'public_key_credential_creation_options']).is_a?(Hash) + self.public_key_credential_creation_options = value + end end end diff --git a/lib/zitadel/client/models/user_service_i_d_p_information.rb b/lib/zitadel/client/models/user_service_remove_i_d_p_link_request.rb similarity index 78% rename from lib/zitadel/client/models/user_service_i_d_p_information.rb rename to lib/zitadel/client/models/user_service_remove_i_d_p_link_request.rb index c4b5b7ab..9a3e1d69 100644 --- a/lib/zitadel/client/models/user_service_i_d_p_information.rb +++ b/lib/zitadel/client/models/user_service_remove_i_d_p_link_request.rb @@ -14,35 +14,19 @@ require 'time' module Zitadel::Client::Models - class UserServiceIDPInformation - attr_accessor :oauth - - attr_accessor :ldap - - attr_accessor :saml - - # ID of the identity provider - attr_accessor :idp_id - - # ID of the user of the identity provider + class UserServiceRemoveIDPLinkRequest attr_accessor :user_id - # username of the user of the identity provider - attr_accessor :user_name + attr_accessor :idp_id - # complete information returned by the identity provider - attr_accessor :raw_information + attr_accessor :linked_user_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'oauth' => :'oauth', - :'ldap' => :'ldap', - :'saml' => :'saml', - :'idp_id' => :'idpId', :'user_id' => :'userId', - :'user_name' => :'userName', - :'raw_information' => :'rawInformation' + :'idp_id' => :'idpId', + :'linked_user_id' => :'linkedUserId' } end @@ -59,13 +43,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'oauth' => :'UserServiceIDPOAuthAccessInformation', - :'ldap' => :'UserServiceIDPLDAPAccessInformation', - :'saml' => :'UserServiceIDPSAMLAccessInformation', - :'idp_id' => :'String', :'user_id' => :'String', - :'user_name' => :'String', - :'raw_information' => :'Object' + :'idp_id' => :'String', + :'linked_user_id' => :'String' } end @@ -80,7 +60,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPInformation` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveIDPLinkRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -88,37 +68,27 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveIDPLinkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'oauth') - self.oauth = attributes[:'oauth'] - end - - if attributes.key?(:'ldap') - self.ldap = attributes[:'ldap'] - end - - if attributes.key?(:'saml') - self.saml = attributes[:'saml'] - end - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] + else + self.user_id = nil end - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] + if attributes.key?(:'idp_id') + self.idp_id = attributes[:'idp_id'] + else + self.idp_id = nil end - if attributes.key?(:'raw_information') - self.raw_information = attributes[:'raw_information'] + if attributes.key?(:'linked_user_id') + self.linked_user_id = attributes[:'linked_user_id'] + else + self.linked_user_id = nil end end @@ -127,6 +97,18 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @idp_id.nil? + invalid_properties.push('invalid value for "idp_id", idp_id cannot be nil.') + end + + if @linked_user_id.nil? + invalid_properties.push('invalid value for "linked_user_id", linked_user_id cannot be nil.') + end + invalid_properties end @@ -134,21 +116,50 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + return false if @idp_id.nil? + return false if @linked_user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] idp_id Value to be assigned + def idp_id=(idp_id) + if idp_id.nil? + fail ArgumentError, 'idp_id cannot be nil' + end + + @idp_id = idp_id + end + + # Custom attribute writer method with validation + # @param [String] linked_user_id Value to be assigned + def linked_user_id=(linked_user_id) + if linked_user_id.nil? + fail ArgumentError, 'linked_user_id cannot be nil' + end + + @linked_user_id = linked_user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - oauth == o.oauth && - ldap == o.ldap && - saml == o.saml && - idp_id == o.idp_id && user_id == o.user_id && - user_name == o.user_name && - raw_information == o.raw_information + idp_id == o.idp_id && + linked_user_id == o.linked_user_id end # @see the `==` method @@ -160,7 +171,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [oauth, ldap, saml, idp_id, user_id, user_name, raw_information].hash + [user_id, idp_id, linked_user_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_remove_o_t_p_email_request.rb b/lib/zitadel/client/models/user_service_remove_o_t_p_email_request.rb new file mode 100644 index 00000000..6a30deb4 --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_o_t_p_email_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceRemoveOTPEmailRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveOTPEmailRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveOTPEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_request.rb b/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_request.rb new file mode 100644 index 00000000..b057f8ce --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceRemoveOTPSMSRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveOTPSMSRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveOTPSMSRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_remove_passkey_request.rb b/lib/zitadel/client/models/user_service_remove_passkey_request.rb new file mode 100644 index 00000000..b1664236 --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_passkey_request.rb @@ -0,0 +1,273 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceRemovePasskeyRequest + attr_accessor :user_id + + attr_accessor :passkey_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'passkey_id' => :'passkeyId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'passkey_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemovePasskeyRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemovePasskeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'passkey_id') + self.passkey_id = attributes[:'passkey_id'] + else + self.passkey_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @passkey_id.nil? + invalid_properties.push('invalid value for "passkey_id", passkey_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + return false if @passkey_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] passkey_id Value to be assigned + def passkey_id=(passkey_id) + if passkey_id.nil? + fail ArgumentError, 'passkey_id cannot be nil' + end + + @passkey_id = passkey_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + passkey_id == o.passkey_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, passkey_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_remove_phone_request.rb b/lib/zitadel/client/models/user_service_remove_phone_request.rb new file mode 100644 index 00000000..14970f56 --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_phone_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceRemovePhoneRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemovePhoneRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemovePhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_r_e_s_t_webhook.rb b/lib/zitadel/client/models/user_service_remove_t_o_t_p_request.rb similarity index 88% rename from lib/zitadel/client/models/action_service_beta_r_e_s_t_webhook.rb rename to lib/zitadel/client/models/user_service_remove_t_o_t_p_request.rb index b240b3ff..41b9bfba 100644 --- a/lib/zitadel/client/models/action_service_beta_r_e_s_t_webhook.rb +++ b/lib/zitadel/client/models/user_service_remove_t_o_t_p_request.rb @@ -14,14 +14,13 @@ require 'time' module Zitadel::Client::Models - class ActionServiceBetaRESTWebhook - # Define if any error stops the whole execution. By default the process continues as normal. - attr_accessor :interrupt_on_error + class UserServiceRemoveTOTPRequest + attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'interrupt_on_error' => :'interruptOnError' + :'user_id' => :'userId' } end @@ -38,7 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'interrupt_on_error' => :'Boolean' + :'user_id' => :'String' } end @@ -53,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaRESTWebhook` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveTOTPRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -61,13 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaRESTWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveTOTPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'interrupt_on_error') - self.interrupt_on_error = attributes[:'interrupt_on_error'] + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil end end @@ -76,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -83,15 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - interrupt_on_error == o.interrupt_on_error + user_id == o.user_id end # @see the `==` method @@ -103,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [interrupt_on_error].hash + [user_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_remove_u2_f_request.rb b/lib/zitadel/client/models/user_service_remove_u2_f_request.rb new file mode 100644 index 00000000..e1e39b2a --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_u2_f_request.rb @@ -0,0 +1,273 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceRemoveU2FRequest + attr_accessor :user_id + + attr_accessor :u2f_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'u2f_id' => :'u2fId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'u2f_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveU2FRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveU2FRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'u2f_id') + self.u2f_id = attributes[:'u2f_id'] + else + self.u2f_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @u2f_id.nil? + invalid_properties.push('invalid value for "u2f_id", u2f_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + return false if @u2f_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] u2f_id Value to be assigned + def u2f_id=(u2f_id) + if u2f_id.nil? + fail ArgumentError, 'u2f_id cannot be nil' + end + + @u2f_id = u2f_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + u2f_id == o.u2f_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, u2f_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_resend_email_code_request.rb b/lib/zitadel/client/models/user_service_resend_email_code_request.rb index 0a93585b..5477b056 100644 --- a/lib/zitadel/client/models/user_service_resend_email_code_request.rb +++ b/lib/zitadel/client/models/user_service_resend_email_code_request.rb @@ -14,226 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceResendEmailCodeRequest - attr_accessor :send_code - - attr_accessor :return_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'send_code' => :'sendCode', - :'return_code' => :'returnCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'send_code' => :'UserServiceSendEmailVerificationCode', - :'return_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendEmailCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendEmailCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceResendEmailCodeRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode2', + :'SendCode2' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - send_code == o.send_code && - return_code == o.return_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [send_code, return_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_resend_email_code_response.rb b/lib/zitadel/client/models/user_service_resend_email_code_response.rb index 3f66585e..b5b4ddc3 100644 --- a/lib/zitadel/client/models/user_service_resend_email_code_response.rb +++ b/lib/zitadel/client/models/user_service_resend_email_code_response.rb @@ -17,6 +17,7 @@ module Zitadel::Client::Models class UserServiceResendEmailCodeResponse attr_accessor :details + # in case the verification was set to return_code, the code will be returned attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. @@ -48,6 +49,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'verification_code' ]) end diff --git a/lib/zitadel/client/models/user_service_resend_invite_code_request.rb b/lib/zitadel/client/models/user_service_resend_invite_code_request.rb new file mode 100644 index 00000000..77609c2d --- /dev/null +++ b/lib/zitadel/client/models/user_service_resend_invite_code_request.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class UserServiceResendInviteCodeRequest + attr_accessor :user_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendInviteCodeRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendInviteCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/user_service_resend_phone_code_request.rb b/lib/zitadel/client/models/user_service_resend_phone_code_request.rb index 4f529081..29a7e7ec 100644 --- a/lib/zitadel/client/models/user_service_resend_phone_code_request.rb +++ b/lib/zitadel/client/models/user_service_resend_phone_code_request.rb @@ -14,226 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceResendPhoneCodeRequest - attr_accessor :send_code - - attr_accessor :return_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'send_code' => :'sendCode', - :'return_code' => :'returnCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'send_code' => :'Object', - :'return_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendPhoneCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendPhoneCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceResendPhoneCodeRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode3', + :'SendCode3' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - send_code == o.send_code && - return_code == o.return_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [send_code, return_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_resend_phone_code_response.rb b/lib/zitadel/client/models/user_service_resend_phone_code_response.rb index 56d7eb45..0883e205 100644 --- a/lib/zitadel/client/models/user_service_resend_phone_code_response.rb +++ b/lib/zitadel/client/models/user_service_resend_phone_code_response.rb @@ -17,6 +17,7 @@ module Zitadel::Client::Models class UserServiceResendPhoneCodeResponse attr_accessor :details + # in case the verification was set to return_code, the code will be returned attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. @@ -48,6 +49,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'verification_code' ]) end diff --git a/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb b/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb index 7a8d45c8..303b61e5 100644 --- a/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb +++ b/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb @@ -15,12 +15,14 @@ module Zitadel::Client::Models class UserServiceRetrieveIdentityProviderIntentRequest - # token of the idp intent, previously returned on the success response of the IDP callback + attr_accessor :idp_intent_id + attr_accessor :idp_intent_token # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'idp_intent_id' => :'idpIntentId', :'idp_intent_token' => :'idpIntentToken' } end @@ -38,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'idp_intent_id' => :'String', :'idp_intent_token' => :'String' } end @@ -66,6 +69,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'idp_intent_id') + self.idp_intent_id = attributes[:'idp_intent_id'] + end + if attributes.key?(:'idp_intent_token') self.idp_intent_token = attributes[:'idp_intent_token'] end @@ -76,14 +83,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@idp_intent_token.nil? && @idp_intent_token.to_s.length > 200 - invalid_properties.push('invalid value for "idp_intent_token", the character length must be smaller than or equal to 200.') - end - - if !@idp_intent_token.nil? && @idp_intent_token.to_s.length < 1 - invalid_properties.push('invalid value for "idp_intent_token", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -91,34 +90,15 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@idp_intent_token.nil? && @idp_intent_token.to_s.length > 200 - return false if !@idp_intent_token.nil? && @idp_intent_token.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] idp_intent_token Value to be assigned - def idp_intent_token=(idp_intent_token) - if idp_intent_token.nil? - fail ArgumentError, 'idp_intent_token cannot be nil' - end - - if idp_intent_token.to_s.length > 200 - fail ArgumentError, 'invalid value for "idp_intent_token", the character length must be smaller than or equal to 200.' - end - - if idp_intent_token.to_s.length < 1 - fail ArgumentError, 'invalid value for "idp_intent_token", the character length must be great than or equal to 1.' - end - - @idp_intent_token = idp_intent_token - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + idp_intent_id == o.idp_intent_id && idp_intent_token == o.idp_intent_token end @@ -131,7 +111,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [idp_intent_token].hash + [idp_intent_id, idp_intent_token].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb b/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb index 8827b956..e6af1217 100644 --- a/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb +++ b/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb @@ -19,7 +19,6 @@ class UserServiceRetrieveIdentityProviderIntentResponse attr_accessor :idp_information - # ID of the user in ZITADEL if external user is linked attr_accessor :user_id attr_accessor :add_human_user diff --git a/lib/zitadel/client/models/user_service_search_query.rb b/lib/zitadel/client/models/user_service_search_query.rb index 84ec646d..e6674edd 100644 --- a/lib/zitadel/client/models/user_service_search_query.rb +++ b/lib/zitadel/client/models/user_service_search_query.rb @@ -14,352 +14,111 @@ require 'time' module Zitadel::Client::Models - class UserServiceSearchQuery - attr_accessor :user_name_query - - attr_accessor :first_name_query - - attr_accessor :last_name_query - - attr_accessor :nick_name_query - - attr_accessor :display_name_query - - attr_accessor :email_query - - attr_accessor :state_query - - attr_accessor :type_query - - attr_accessor :login_name_query - - attr_accessor :in_user_ids_query - - attr_accessor :or_query - - attr_accessor :and_query - - attr_accessor :not_query - - attr_accessor :in_user_emails_query - - attr_accessor :organization_id_query - - attr_accessor :phone_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_name_query' => :'userNameQuery', - :'first_name_query' => :'firstNameQuery', - :'last_name_query' => :'lastNameQuery', - :'nick_name_query' => :'nickNameQuery', - :'display_name_query' => :'displayNameQuery', - :'email_query' => :'emailQuery', - :'state_query' => :'stateQuery', - :'type_query' => :'typeQuery', - :'login_name_query' => :'loginNameQuery', - :'in_user_ids_query' => :'inUserIdsQuery', - :'or_query' => :'orQuery', - :'and_query' => :'andQuery', - :'not_query' => :'notQuery', - :'in_user_emails_query' => :'inUserEmailsQuery', - :'organization_id_query' => :'organizationIdQuery', - :'phone_query' => :'phoneQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_name_query' => :'UserServiceUserNameQuery', - :'first_name_query' => :'UserServiceFirstNameQuery', - :'last_name_query' => :'UserServiceLastNameQuery', - :'nick_name_query' => :'UserServiceNickNameQuery', - :'display_name_query' => :'UserServiceDisplayNameQuery', - :'email_query' => :'UserServiceEmailQuery', - :'state_query' => :'UserServiceStateQuery', - :'type_query' => :'UserServiceTypeQuery', - :'login_name_query' => :'UserServiceLoginNameQuery', - :'in_user_ids_query' => :'UserServiceInUserIDQuery', - :'or_query' => :'UserServiceOrQuery', - :'and_query' => :'UserServiceAndQuery', - :'not_query' => :'UserServiceNotQuery', - :'in_user_emails_query' => :'UserServiceInUserEmailsQuery', - :'organization_id_query' => :'UserServiceOrganizationIdQuery', - :'phone_query' => :'UserServicePhoneQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceSearchQuery + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'AndQuery', + :'DisplayNameQuery', + :'EmailQuery', + :'FirstNameQuery', + :'InUserEmailsQuery', + :'InUserIdsQuery', + :'LastNameQuery', + :'LoginNameQuery', + :'NickNameQuery', + :'NotQuery', + :'OrQuery', + :'OrganizationIdQuery', + :'PhoneQuery', + :'StateQuery', + :'TypeQuery', + :'UserNameQuery' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'user_name_query') - self.user_name_query = attributes[:'user_name_query'] - end - - if attributes.key?(:'first_name_query') - self.first_name_query = attributes[:'first_name_query'] - end - - if attributes.key?(:'last_name_query') - self.last_name_query = attributes[:'last_name_query'] - end - - if attributes.key?(:'nick_name_query') - self.nick_name_query = attributes[:'nick_name_query'] - end - - if attributes.key?(:'display_name_query') - self.display_name_query = attributes[:'display_name_query'] - end - - if attributes.key?(:'email_query') - self.email_query = attributes[:'email_query'] - end - - if attributes.key?(:'state_query') - self.state_query = attributes[:'state_query'] - end - - if attributes.key?(:'type_query') - self.type_query = attributes[:'type_query'] - end - - if attributes.key?(:'login_name_query') - self.login_name_query = attributes[:'login_name_query'] - end - - if attributes.key?(:'in_user_ids_query') - self.in_user_ids_query = attributes[:'in_user_ids_query'] end - if attributes.key?(:'or_query') - self.or_query = attributes[:'or_query'] - end - - if attributes.key?(:'and_query') - self.and_query = attributes[:'and_query'] - end - - if attributes.key?(:'not_query') - self.not_query = attributes[:'not_query'] - end - - if attributes.key?(:'in_user_emails_query') - self.in_user_emails_query = attributes[:'in_user_emails_query'] - end - - if attributes.key?(:'organization_id_query') - self.organization_id_query = attributes[:'organization_id_query'] - end - - if attributes.key?(:'phone_query') - self.phone_query = attributes[:'phone_query'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_name_query == o.user_name_query && - first_name_query == o.first_name_query && - last_name_query == o.last_name_query && - nick_name_query == o.nick_name_query && - display_name_query == o.display_name_query && - email_query == o.email_query && - state_query == o.state_query && - type_query == o.type_query && - login_name_query == o.login_name_query && - in_user_ids_query == o.in_user_ids_query && - or_query == o.or_query && - and_query == o.and_query && - not_query == o.not_query && - in_user_emails_query == o.in_user_emails_query && - organization_id_query == o.organization_id_query && - phone_query == o.phone_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_name_query, first_name_query, last_name_query, nick_name_query, display_name_query, email_query, state_query, type_query, login_name_query, in_user_ids_query, or_query, and_query, not_query, in_user_emails_query, organization_id_query, phone_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_send_email_code_request.rb b/lib/zitadel/client/models/user_service_send_email_code_request.rb index 5d24f6ad..b932f8dc 100644 --- a/lib/zitadel/client/models/user_service_send_email_code_request.rb +++ b/lib/zitadel/client/models/user_service_send_email_code_request.rb @@ -14,226 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceSendEmailCodeRequest - attr_accessor :send_code - - attr_accessor :return_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'send_code' => :'sendCode', - :'return_code' => :'returnCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'send_code' => :'UserServiceSendEmailVerificationCode', - :'return_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendEmailCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendEmailCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceSendEmailCodeRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ReturnCode2', + :'SendCode2' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - send_code == o.send_code && - return_code == o.return_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [send_code, return_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_send_email_code_response.rb b/lib/zitadel/client/models/user_service_send_email_code_response.rb index 7f6f3cec..adfd1e61 100644 --- a/lib/zitadel/client/models/user_service_send_email_code_response.rb +++ b/lib/zitadel/client/models/user_service_send_email_code_response.rb @@ -17,6 +17,7 @@ module Zitadel::Client::Models class UserServiceSendEmailCodeResponse attr_accessor :details + # in case the verification was set to return_code, the code will be returned attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. @@ -48,6 +49,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'verification_code' ]) end diff --git a/lib/zitadel/client/models/user_service_send_email_verification_code.rb b/lib/zitadel/client/models/user_service_send_email_verification_code.rb deleted file mode 100644 index 320d5d09..00000000 --- a/lib/zitadel/client/models/user_service_send_email_verification_code.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceSendEmailVerificationCode - # Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendEmailVerificationCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendEmailVerificationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@url_template.nil? && @url_template.to_s.length > 200 - invalid_properties.push('invalid value for "url_template", the character length must be smaller than or equal to 200.') - end - - if !@url_template.nil? && @url_template.to_s.length < 1 - invalid_properties.push('invalid value for "url_template", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@url_template.nil? && @url_template.to_s.length > 200 - return false if !@url_template.nil? && @url_template.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] url_template Value to be assigned - def url_template=(url_template) - if url_template.nil? - fail ArgumentError, 'url_template cannot be nil' - end - - if url_template.to_s.length > 200 - fail ArgumentError, 'invalid value for "url_template", the character length must be smaller than or equal to 200.' - end - - if url_template.to_s.length < 1 - fail ArgumentError, 'invalid value for "url_template", the character length must be great than or equal to 1.' - end - - @url_template = url_template - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_send_invite_code.rb b/lib/zitadel/client/models/user_service_send_invite_code.rb deleted file mode 100644 index 2c785487..00000000 --- a/lib/zitadel/client/models/user_service_send_invite_code.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceSendInviteCode - # Optionally set a url_template, which will be used in the invite mail sent by ZITADEL to guide the user to your invitation page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code - attr_accessor :url_template - - # Optionally set an application name, which will be used in the invite mail sent by ZITADEL. If no application name is set, ZITADEL will be used as default. - attr_accessor :application_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate', - :'application_name' => :'applicationName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String', - :'application_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendInviteCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendInviteCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - - if attributes.key?(:'application_name') - self.application_name = attributes[:'application_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@url_template.nil? && @url_template.to_s.length > 200 - invalid_properties.push('invalid value for "url_template", the character length must be smaller than or equal to 200.') - end - - if !@url_template.nil? && @url_template.to_s.length < 1 - invalid_properties.push('invalid value for "url_template", the character length must be great than or equal to 1.') - end - - if !@application_name.nil? && @application_name.to_s.length > 200 - invalid_properties.push('invalid value for "application_name", the character length must be smaller than or equal to 200.') - end - - if !@application_name.nil? && @application_name.to_s.length < 1 - invalid_properties.push('invalid value for "application_name", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@url_template.nil? && @url_template.to_s.length > 200 - return false if !@url_template.nil? && @url_template.to_s.length < 1 - return false if !@application_name.nil? && @application_name.to_s.length > 200 - return false if !@application_name.nil? && @application_name.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] url_template Value to be assigned - def url_template=(url_template) - if url_template.nil? - fail ArgumentError, 'url_template cannot be nil' - end - - if url_template.to_s.length > 200 - fail ArgumentError, 'invalid value for "url_template", the character length must be smaller than or equal to 200.' - end - - if url_template.to_s.length < 1 - fail ArgumentError, 'invalid value for "url_template", the character length must be great than or equal to 1.' - end - - @url_template = url_template - end - - # Custom attribute writer method with validation - # @param [Object] application_name Value to be assigned - def application_name=(application_name) - if application_name.nil? - fail ArgumentError, 'application_name cannot be nil' - end - - if application_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "application_name", the character length must be smaller than or equal to 200.' - end - - if application_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "application_name", the character length must be great than or equal to 1.' - end - - @application_name = application_name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template && - application_name == o.application_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template, application_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_set_email_request.rb b/lib/zitadel/client/models/user_service_set_email_request.rb index df755e8d..56516409 100644 --- a/lib/zitadel/client/models/user_service_set_email_request.rb +++ b/lib/zitadel/client/models/user_service_set_email_request.rb @@ -14,279 +14,98 @@ require 'time' module Zitadel::Client::Models - class UserServiceSetEmailRequest - attr_accessor :email - - attr_accessor :send_code - - attr_accessor :return_code - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'send_code' => :'sendCode', - :'return_code' => :'returnCode', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'send_code' => :'UserServiceSendEmailVerificationCode', - :'return_code' => :'Object', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceSetEmailRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IsVerified', + :'ReturnCode2', + :'SendCode2' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - else - self.email = nil - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @email.nil? - invalid_properties.push('invalid value for "email", email cannot be nil.') - end - - if @email.to_s.length > 200 - invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 200.') - end - - if @email.to_s.length < 1 - invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @email.nil? - return false if @email.to_s.length > 200 - return false if @email.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] email Value to be assigned - def email=(email) - if email.nil? - fail ArgumentError, 'email cannot be nil' end - if email.to_s.length > 200 - fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 200.' - end - - if email.to_s.length < 1 - fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' - end - - @email = email - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - send_code == o.send_code && - return_code == o.return_code && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, send_code, return_code, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_email_response.rb b/lib/zitadel/client/models/user_service_set_email_response.rb index 124d0afe..d6ff64ad 100644 --- a/lib/zitadel/client/models/user_service_set_email_response.rb +++ b/lib/zitadel/client/models/user_service_set_email_response.rb @@ -17,6 +17,7 @@ module Zitadel::Client::Models class UserServiceSetEmailResponse attr_accessor :details + # in case the verification was set to return_code, the code will be returned attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. @@ -48,6 +49,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'verification_code' ]) end diff --git a/lib/zitadel/client/models/user_service_set_human_email.rb b/lib/zitadel/client/models/user_service_set_human_email.rb index 52a15ac5..c6795dad 100644 --- a/lib/zitadel/client/models/user_service_set_human_email.rb +++ b/lib/zitadel/client/models/user_service_set_human_email.rb @@ -14,279 +14,98 @@ require 'time' module Zitadel::Client::Models - class UserServiceSetHumanEmail - attr_accessor :email - - attr_accessor :send_code - - attr_accessor :return_code - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'send_code' => :'sendCode', - :'return_code' => :'returnCode', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'send_code' => :'UserServiceSendEmailVerificationCode', - :'return_code' => :'Object', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetHumanEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetHumanEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceSetHumanEmail + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IsVerified', + :'ReturnCode2', + :'SendCode2' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - else - self.email = nil - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @email.nil? - invalid_properties.push('invalid value for "email", email cannot be nil.') - end - - if @email.to_s.length > 200 - invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 200.') - end - - if @email.to_s.length < 1 - invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @email.nil? - return false if @email.to_s.length > 200 - return false if @email.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] email Value to be assigned - def email=(email) - if email.nil? - fail ArgumentError, 'email cannot be nil' end - if email.to_s.length > 200 - fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 200.' - end - - if email.to_s.length < 1 - fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' - end - - @email = email - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - send_code == o.send_code && - return_code == o.return_code && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, send_code, return_code, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_human_phone.rb b/lib/zitadel/client/models/user_service_set_human_phone.rb index 31662441..8e6a060c 100644 --- a/lib/zitadel/client/models/user_service_set_human_phone.rb +++ b/lib/zitadel/client/models/user_service_set_human_phone.rb @@ -14,263 +14,98 @@ require 'time' module Zitadel::Client::Models - class UserServiceSetHumanPhone - attr_accessor :phone - - attr_accessor :send_code - - attr_accessor :return_code - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone' => :'phone', - :'send_code' => :'sendCode', - :'return_code' => :'returnCode', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone' => :'String', - :'send_code' => :'Object', - :'return_code' => :'Object', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetHumanPhone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetHumanPhone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceSetHumanPhone + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IsVerified', + :'ReturnCode3', + :'SendCode3' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@phone.nil? && @phone.to_s.length > 200 - invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 200.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@phone.nil? && @phone.to_s.length > 200 - true - end - - # Custom attribute writer method with validation - # @param [Object] phone Value to be assigned - def phone=(phone) - if phone.nil? - fail ArgumentError, 'phone cannot be nil' - end - - if phone.to_s.length > 200 - fail ArgumentError, 'invalid value for "phone", the character length must be smaller than or equal to 200.' end - @phone = phone - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone == o.phone && - send_code == o.send_code && - return_code == o.return_code && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone, send_code, return_code, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - elsif value.respond_to? :to_hash - value.to_hash - else - value end end - end - end diff --git a/lib/zitadel/client/models/user_service_set_human_profile.rb b/lib/zitadel/client/models/user_service_set_human_profile.rb index 9f023728..f3559311 100644 --- a/lib/zitadel/client/models/user_service_set_human_profile.rb +++ b/lib/zitadel/client/models/user_service_set_human_profile.rb @@ -86,6 +86,9 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'nick_name', + :'display_name', + :'preferred_language', ]) end @@ -133,8 +136,6 @@ def initialize(attributes = {}) if attributes.key?(:'gender') self.gender = attributes[:'gender'] - else - self.gender = 'GENDER_UNSPECIFIED' end end @@ -147,38 +148,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') end - if @given_name.to_s.length > 200 - invalid_properties.push('invalid value for "given_name", the character length must be smaller than or equal to 200.') - end - - if @given_name.to_s.length < 1 - invalid_properties.push('invalid value for "given_name", the character length must be great than or equal to 1.') - end - if @family_name.nil? invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') end - if @family_name.to_s.length > 200 - invalid_properties.push('invalid value for "family_name", the character length must be smaller than or equal to 200.') - end - - if @family_name.to_s.length < 1 - invalid_properties.push('invalid value for "family_name", the character length must be great than or equal to 1.') - end - - if !@nick_name.nil? && @nick_name.to_s.length > 200 - invalid_properties.push('invalid value for "nick_name", the character length must be smaller than or equal to 200.') - end - - if !@display_name.nil? && @display_name.to_s.length > 200 - invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 200.') - end - - if !@preferred_language.nil? && @preferred_language.to_s.length > 10 - invalid_properties.push('invalid value for "preferred_language", the character length must be smaller than or equal to 10.') - end - invalid_properties end @@ -187,95 +160,30 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @given_name.nil? - return false if @given_name.to_s.length > 200 - return false if @given_name.to_s.length < 1 return false if @family_name.nil? - return false if @family_name.to_s.length > 200 - return false if @family_name.to_s.length < 1 - return false if !@nick_name.nil? && @nick_name.to_s.length > 200 - return false if !@display_name.nil? && @display_name.to_s.length > 200 - return false if !@preferred_language.nil? && @preferred_language.to_s.length > 10 true end # Custom attribute writer method with validation - # @param [Object] given_name Value to be assigned + # @param [String] given_name Value to be assigned def given_name=(given_name) if given_name.nil? fail ArgumentError, 'given_name cannot be nil' end - if given_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "given_name", the character length must be smaller than or equal to 200.' - end - - if given_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "given_name", the character length must be great than or equal to 1.' - end - @given_name = given_name end # Custom attribute writer method with validation - # @param [Object] family_name Value to be assigned + # @param [String] family_name Value to be assigned def family_name=(family_name) if family_name.nil? fail ArgumentError, 'family_name cannot be nil' end - if family_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "family_name", the character length must be smaller than or equal to 200.' - end - - if family_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "family_name", the character length must be great than or equal to 1.' - end - @family_name = family_name end - # Custom attribute writer method with validation - # @param [Object] nick_name Value to be assigned - def nick_name=(nick_name) - if nick_name.nil? - fail ArgumentError, 'nick_name cannot be nil' - end - - if nick_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "nick_name", the character length must be smaller than or equal to 200.' - end - - @nick_name = nick_name - end - - # Custom attribute writer method with validation - # @param [Object] display_name Value to be assigned - def display_name=(display_name) - if display_name.nil? - fail ArgumentError, 'display_name cannot be nil' - end - - if display_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 200.' - end - - @display_name = display_name - end - - # Custom attribute writer method with validation - # @param [Object] preferred_language Value to be assigned - def preferred_language=(preferred_language) - if preferred_language.nil? - fail ArgumentError, 'preferred_language cannot be nil' - end - - if preferred_language.to_s.length > 10 - fail ArgumentError, 'invalid value for "preferred_language", the character length must be smaller than or equal to 10.' - end - - @preferred_language = preferred_language - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/user_service_set_metadata_entry.rb b/lib/zitadel/client/models/user_service_set_metadata_entry.rb index a2be6e20..f644ebc6 100644 --- a/lib/zitadel/client/models/user_service_set_metadata_entry.rb +++ b/lib/zitadel/client/models/user_service_set_metadata_entry.rb @@ -17,7 +17,6 @@ module Zitadel::Client::Models class UserServiceSetMetadataEntry attr_accessor :key - # The value has to be base64 encoded. attr_accessor :value # Attribute mapping from ruby-style variable name to JSON key. @@ -92,26 +91,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "key", key cannot be nil.') end - if @key.to_s.length > 200 - invalid_properties.push('invalid value for "key", the character length must be smaller than or equal to 200.') - end - - if @key.to_s.length < 1 - invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.') - end - if @value.nil? invalid_properties.push('invalid value for "value", value cannot be nil.') end - if @value.to_s.length > 500000 - invalid_properties.push('invalid value for "value", the character length must be smaller than or equal to 500000.') - end - - if @value.to_s.length < 1 - invalid_properties.push('invalid value for "value", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -120,47 +103,27 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @key.nil? - return false if @key.to_s.length > 200 - return false if @key.to_s.length < 1 return false if @value.nil? - return false if @value.to_s.length > 500000 - return false if @value.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] key Value to be assigned + # @param [String] key Value to be assigned def key=(key) if key.nil? fail ArgumentError, 'key cannot be nil' end - if key.to_s.length > 200 - fail ArgumentError, 'invalid value for "key", the character length must be smaller than or equal to 200.' - end - - if key.to_s.length < 1 - fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.' - end - @key = key end # Custom attribute writer method with validation - # @param [Object] value Value to be assigned + # @param [String] value Value to be assigned def value=(value) if value.nil? fail ArgumentError, 'value cannot be nil' end - if value.to_s.length > 500000 - fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to 500000.' - end - - if value.to_s.length < 1 - fail ArgumentError, 'invalid value for "value", the character length must be great than or equal to 1.' - end - @value = value end diff --git a/lib/zitadel/client/models/user_service_set_password.rb b/lib/zitadel/client/models/user_service_set_password.rb index 80b40dfb..f4a17674 100644 --- a/lib/zitadel/client/models/user_service_set_password.rb +++ b/lib/zitadel/client/models/user_service_set_password.rb @@ -15,20 +15,19 @@ module Zitadel::Client::Models class UserServiceSetPassword - attr_accessor :password - attr_accessor :hashed_password + attr_accessor :password + attr_accessor :current_password - # \"the verification code generated during password reset request\" attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'password' => :'password', :'hashed_password' => :'hashedPassword', + :'password' => :'password', :'current_password' => :'currentPassword', :'verification_code' => :'verificationCode' } @@ -47,8 +46,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'password' => :'UserServicePassword', :'hashed_password' => :'UserServiceHashedPassword', + :'password' => :'UserServicePassword', :'current_password' => :'String', :'verification_code' => :'String' } @@ -78,12 +77,16 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - if attributes.key?(:'hashed_password') self.hashed_password = attributes[:'hashed_password'] + else + self.hashed_password = nil + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + else + self.password = nil end if attributes.key?(:'current_password') @@ -104,30 +107,22 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @current_password.nil? - invalid_properties.push('invalid value for "current_password", current_password cannot be nil.') + if @hashed_password.nil? + invalid_properties.push('invalid value for "hashed_password", hashed_password cannot be nil.') end - if @current_password.to_s.length > 200 - invalid_properties.push('invalid value for "current_password", the character length must be smaller than or equal to 200.') + if @password.nil? + invalid_properties.push('invalid value for "password", password cannot be nil.') end - if @current_password.to_s.length < 1 - invalid_properties.push('invalid value for "current_password", the character length must be great than or equal to 1.') + if @current_password.nil? + invalid_properties.push('invalid value for "current_password", current_password cannot be nil.') end if @verification_code.nil? invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') end - if @verification_code.to_s.length > 20 - invalid_properties.push('invalid value for "verification_code", the character length must be smaller than or equal to 20.') - end - - if @verification_code.to_s.length < 1 - invalid_properties.push('invalid value for "verification_code", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -135,48 +130,50 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @hashed_password.nil? + return false if @password.nil? return false if @current_password.nil? - return false if @current_password.to_s.length > 200 - return false if @current_password.to_s.length < 1 return false if @verification_code.nil? - return false if @verification_code.to_s.length > 20 - return false if @verification_code.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] current_password Value to be assigned - def current_password=(current_password) - if current_password.nil? - fail ArgumentError, 'current_password cannot be nil' + # @param [UserServiceHashedPassword] hashed_password Value to be assigned + def hashed_password=(hashed_password) + if hashed_password.nil? + fail ArgumentError, 'hashed_password cannot be nil' end - if current_password.to_s.length > 200 - fail ArgumentError, 'invalid value for "current_password", the character length must be smaller than or equal to 200.' + @hashed_password = hashed_password + end + + # Custom attribute writer method with validation + # @param [UserServicePassword] password Value to be assigned + def password=(password) + if password.nil? + fail ArgumentError, 'password cannot be nil' end - if current_password.to_s.length < 1 - fail ArgumentError, 'invalid value for "current_password", the character length must be great than or equal to 1.' + @password = password + end + + # Custom attribute writer method with validation + # @param [String] current_password Value to be assigned + def current_password=(current_password) + if current_password.nil? + fail ArgumentError, 'current_password cannot be nil' end @current_password = current_password end # Custom attribute writer method with validation - # @param [Object] verification_code Value to be assigned + # @param [String] verification_code Value to be assigned def verification_code=(verification_code) if verification_code.nil? fail ArgumentError, 'verification_code cannot be nil' end - if verification_code.to_s.length > 20 - fail ArgumentError, 'invalid value for "verification_code", the character length must be smaller than or equal to 20.' - end - - if verification_code.to_s.length < 1 - fail ArgumentError, 'invalid value for "verification_code", the character length must be great than or equal to 1.' - end - @verification_code = verification_code end @@ -185,8 +182,8 @@ def verification_code=(verification_code) def ==(o) return true if self.equal?(o) self.class == o.class && - password == o.password && hashed_password == o.hashed_password && + password == o.password && current_password == o.current_password && verification_code == o.verification_code end @@ -200,7 +197,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [password, hashed_password, current_password, verification_code].hash + [hashed_password, password, current_password, verification_code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_set_password_request.rb b/lib/zitadel/client/models/user_service_set_password_request.rb index 5311477f..5bd9ebcc 100644 --- a/lib/zitadel/client/models/user_service_set_password_request.rb +++ b/lib/zitadel/client/models/user_service_set_password_request.rb @@ -14,306 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceSetPasswordRequest - attr_accessor :new_password - - attr_accessor :current_password - - # \"the verification code generated during password reset request\" - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'new_password' => :'newPassword', - :'current_password' => :'currentPassword', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'new_password' => :'UserServicePassword', - :'current_password' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetPasswordRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetPasswordRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceSetPasswordRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CurrentPassword', + :'VerificationCode' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'new_password') - self.new_password = attributes[:'new_password'] - end - - if attributes.key?(:'current_password') - self.current_password = attributes[:'current_password'] - else - self.current_password = nil - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - else - self.verification_code = nil - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @current_password.nil? - invalid_properties.push('invalid value for "current_password", current_password cannot be nil.') - end - - if @current_password.to_s.length > 200 - invalid_properties.push('invalid value for "current_password", the character length must be smaller than or equal to 200.') - end - - if @current_password.to_s.length < 1 - invalid_properties.push('invalid value for "current_password", the character length must be great than or equal to 1.') end - if @verification_code.nil? - invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') - end - - if @verification_code.to_s.length > 20 - invalid_properties.push('invalid value for "verification_code", the character length must be smaller than or equal to 20.') - end - - if @verification_code.to_s.length < 1 - invalid_properties.push('invalid value for "verification_code", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @current_password.nil? - return false if @current_password.to_s.length > 200 - return false if @current_password.to_s.length < 1 - return false if @verification_code.nil? - return false if @verification_code.to_s.length > 20 - return false if @verification_code.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] current_password Value to be assigned - def current_password=(current_password) - if current_password.nil? - fail ArgumentError, 'current_password cannot be nil' - end - - if current_password.to_s.length > 200 - fail ArgumentError, 'invalid value for "current_password", the character length must be smaller than or equal to 200.' - end - - if current_password.to_s.length < 1 - fail ArgumentError, 'invalid value for "current_password", the character length must be great than or equal to 1.' - end - - @current_password = current_password - end - - # Custom attribute writer method with validation - # @param [Object] verification_code Value to be assigned - def verification_code=(verification_code) - if verification_code.nil? - fail ArgumentError, 'verification_code cannot be nil' - end - - if verification_code.to_s.length > 20 - fail ArgumentError, 'invalid value for "verification_code", the character length must be smaller than or equal to 20.' - end - - if verification_code.to_s.length < 1 - fail ArgumentError, 'invalid value for "verification_code", the character length must be great than or equal to 1.' - end - - @verification_code = verification_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - new_password == o.new_password && - current_password == o.current_password && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [new_password, current_password, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - elsif value.respond_to? :to_hash - value.to_hash - else - value end end - end - end diff --git a/lib/zitadel/client/models/user_service_set_phone_request.rb b/lib/zitadel/client/models/user_service_set_phone_request.rb index 321ea1f4..8368503a 100644 --- a/lib/zitadel/client/models/user_service_set_phone_request.rb +++ b/lib/zitadel/client/models/user_service_set_phone_request.rb @@ -14,279 +14,98 @@ require 'time' module Zitadel::Client::Models - class UserServiceSetPhoneRequest - attr_accessor :phone - - attr_accessor :send_code - - attr_accessor :return_code - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone' => :'phone', - :'send_code' => :'sendCode', - :'return_code' => :'returnCode', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone' => :'String', - :'send_code' => :'Object', - :'return_code' => :'Object', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetPhoneRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetPhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceSetPhoneRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IsVerified', + :'ReturnCode3', + :'SendCode3' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - else - self.phone = nil - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @phone.nil? - invalid_properties.push('invalid value for "phone", phone cannot be nil.') - end - - if @phone.to_s.length > 200 - invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 200.') - end - - if @phone.to_s.length < 1 - invalid_properties.push('invalid value for "phone", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @phone.nil? - return false if @phone.to_s.length > 200 - return false if @phone.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] phone Value to be assigned - def phone=(phone) - if phone.nil? - fail ArgumentError, 'phone cannot be nil' end - if phone.to_s.length > 200 - fail ArgumentError, 'invalid value for "phone", the character length must be smaller than or equal to 200.' - end - - if phone.to_s.length < 1 - fail ArgumentError, 'invalid value for "phone", the character length must be great than or equal to 1.' - end - - @phone = phone - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone == o.phone && - send_code == o.send_code && - return_code == o.return_code && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone, send_code, return_code, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_phone_response.rb b/lib/zitadel/client/models/user_service_set_phone_response.rb index 7538b765..c2be56d0 100644 --- a/lib/zitadel/client/models/user_service_set_phone_response.rb +++ b/lib/zitadel/client/models/user_service_set_phone_response.rb @@ -17,6 +17,7 @@ module Zitadel::Client::Models class UserServiceSetPhoneResponse attr_accessor :details + # in case the verification was set to return_code, the code will be returned attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. @@ -48,6 +49,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'verification_code' ]) end diff --git a/lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb b/lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb index e1a29887..09170ab4 100644 --- a/lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb +++ b/lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb @@ -14,264 +14,97 @@ require 'time' module Zitadel::Client::Models - class UserServiceStartIdentityProviderIntentRequest - # ID for existing identity provider - attr_accessor :idp_id - - attr_accessor :urls - - attr_accessor :ldap - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'urls' => :'urls', - :'ldap' => :'ldap' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'urls' => :'UserServiceRedirectURLs', - :'ldap' => :'UserServiceLDAPCredentials' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceStartIdentityProviderIntentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceStartIdentityProviderIntentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceStartIdentityProviderIntentRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Ldap1', + :'Urls' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'urls') - self.urls = attributes[:'urls'] end - if attributes.key?(:'ldap') - self.ldap = attributes[:'ldap'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if !@idp_id.nil? && @idp_id.to_s.length > 200 - invalid_properties.push('invalid value for "idp_id", the character length must be smaller than or equal to 200.') - end - - if !@idp_id.nil? && @idp_id.to_s.length < 1 - invalid_properties.push('invalid value for "idp_id", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@idp_id.nil? && @idp_id.to_s.length > 200 - return false if !@idp_id.nil? && @idp_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] idp_id Value to be assigned - def idp_id=(idp_id) - if idp_id.nil? - fail ArgumentError, 'idp_id cannot be nil' - end - - if idp_id.to_s.length > 200 - fail ArgumentError, 'invalid value for "idp_id", the character length must be smaller than or equal to 200.' - end - - if idp_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "idp_id", the character length must be great than or equal to 1.' - end - - @idp_id = idp_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - urls == o.urls && - ldap == o.ldap - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, urls, ldap].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - elsif value.respond_to? :to_hash - value.to_hash - else - value end end - end - end diff --git a/lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb b/lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb index 85f784b7..1472c1b6 100644 --- a/lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb +++ b/lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb @@ -14,246 +14,98 @@ require 'time' module Zitadel::Client::Models - class UserServiceStartIdentityProviderIntentResponse - attr_accessor :details - - # URL to which the client should redirect - attr_accessor :auth_url - - attr_accessor :idp_intent - - # POST call information - attr_accessor :post_form - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'auth_url' => :'authUrl', - :'idp_intent' => :'idpIntent', - :'post_form' => :'postForm' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'auth_url' => :'String', - :'idp_intent' => :'UserServiceIDPIntent', - :'post_form' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceStartIdentityProviderIntentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceStartIdentityProviderIntentResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect +module UserServiceStartIdentityProviderIntentResponse + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'AuthUrl', + :'IdpIntent', + :'PostForm' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'auth_url') - self.auth_url = attributes[:'auth_url'] - end - - if attributes.key?(:'idp_intent') - self.idp_intent = attributes[:'idp_intent'] - end - - if attributes.key?(:'post_form') - self.post_form = attributes[:'post_form'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - auth_url == o.auth_url && - idp_intent == o.idp_intent && - post_form == o.post_form - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, auth_url, idp_intent, post_form].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" end - - hash[param] = _to_hash(value) end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_text_query_method.rb b/lib/zitadel/client/models/user_service_text_query_method.rb deleted file mode 100644 index 52a96305..00000000 --- a/lib/zitadel/client/models/user_service_text_query_method.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceTextQueryMethod - TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS".freeze - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH".freeze - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS".freeze - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH".freeze - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceTextQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceTextQueryMethod" - end - end - -end diff --git a/lib/zitadel/client/models/organization_service_rpc_status.rb b/lib/zitadel/client/models/user_service_unlock_user_request.rb similarity index 88% rename from lib/zitadel/client/models/organization_service_rpc_status.rb rename to lib/zitadel/client/models/user_service_unlock_user_request.rb index f42b6076..20397543 100644 --- a/lib/zitadel/client/models/organization_service_rpc_status.rb +++ b/lib/zitadel/client/models/user_service_unlock_user_request.rb @@ -14,19 +14,13 @@ require 'time' module Zitadel::Client::Models - class OrganizationServiceRpcStatus - attr_accessor :code - - attr_accessor :message - - attr_accessor :details + class UserServiceUnlockUserRequest + attr_accessor :user_id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' + :'user_id' => :'userId' } end @@ -43,9 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'code' => :'Integer', - :'message' => :'String', - :'details' => :'Array' + :'user_id' => :'String' } end @@ -60,7 +52,7 @@ def self.openapi_nullable def initialize(attributes = {}) if (!attributes.is_a?(Hash)) # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceRpcStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUnlockUserRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key @@ -68,23 +60,15 @@ def initialize(attributes = {}) attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceRpcStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUnlockUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil end end @@ -93,6 +77,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + invalid_properties end @@ -100,17 +88,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? true end + # Custom attribute writer method with validation + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - code == o.code && - message == o.message && - details == o.details + user_id == o.user_id end # @see the `==` method @@ -122,7 +119,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, details].hash + [user_id].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_update_human_user_request.rb b/lib/zitadel/client/models/user_service_update_human_user_request.rb index 11618e09..99036bf4 100644 --- a/lib/zitadel/client/models/user_service_update_human_user_request.rb +++ b/lib/zitadel/client/models/user_service_update_human_user_request.rb @@ -15,6 +15,8 @@ module Zitadel::Client::Models class UserServiceUpdateHumanUserRequest + attr_accessor :user_id + attr_accessor :username attr_accessor :profile @@ -28,6 +30,7 @@ class UserServiceUpdateHumanUserRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'username' => :'username', :'profile' => :'profile', :'email' => :'email', @@ -49,6 +52,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'username' => :'String', :'profile' => :'UserServiceSetHumanProfile', :'email' => :'UserServiceSetHumanEmail', @@ -60,6 +64,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'username', ]) end @@ -81,6 +86,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + if attributes.key?(:'username') self.username = attributes[:'username'] end @@ -107,14 +116,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if !@username.nil? && @username.to_s.length > 200 - invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 200.') - end - - if !@username.nil? && @username.to_s.length < 1 - invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.') - end - invalid_properties end @@ -122,34 +123,15 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if !@username.nil? && @username.to_s.length > 200 - return false if !@username.nil? && @username.to_s.length < 1 true end - # Custom attribute writer method with validation - # @param [Object] username Value to be assigned - def username=(username) - if username.nil? - fail ArgumentError, 'username cannot be nil' - end - - if username.to_s.length > 200 - fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 200.' - end - - if username.to_s.length < 1 - fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.' - end - - @username = username - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && username == o.username && profile == o.profile && email == o.email && @@ -166,7 +148,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [username, profile, email, phone, password].hash + [user_id, username, profile, email, phone, password].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_update_human_user_response.rb b/lib/zitadel/client/models/user_service_update_human_user_response.rb index f026d4bf..408ff787 100644 --- a/lib/zitadel/client/models/user_service_update_human_user_response.rb +++ b/lib/zitadel/client/models/user_service_update_human_user_response.rb @@ -52,6 +52,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'email_code', + :'phone_code' ]) end diff --git a/lib/zitadel/client/models/user_service_user.rb b/lib/zitadel/client/models/user_service_user.rb index c03797de..0d9e5d52 100644 --- a/lib/zitadel/client/models/user_service_user.rb +++ b/lib/zitadel/client/models/user_service_user.rb @@ -31,6 +31,28 @@ class UserServiceUser attr_accessor :machine + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -64,7 +86,7 @@ def self.openapi_types :'username' => :'String', :'login_names' => :'Array', :'preferred_login_name' => :'String', - :'human' => :'UserServiceHumanUser', + :'human' => :'Null', :'machine' => :'UserServiceMachineUser' } end @@ -103,8 +125,6 @@ def initialize(attributes = {}) if attributes.key?(:'state') self.state = attributes[:'state'] - else - self.state = 'USER_STATE_UNSPECIFIED' end if attributes.key?(:'username') @@ -123,10 +143,14 @@ def initialize(attributes = {}) if attributes.key?(:'human') self.human = attributes[:'human'] + else + self.human = nil end if attributes.key?(:'machine') self.machine = attributes[:'machine'] + else + self.machine = nil end end @@ -135,6 +159,14 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @human.nil? + invalid_properties.push('invalid value for "human", human cannot be nil.') + end + + if @machine.nil? + invalid_properties.push('invalid value for "machine", machine cannot be nil.') + end + invalid_properties end @@ -142,9 +174,31 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @human.nil? + return false if @machine.nil? true end + # Custom attribute writer method with validation + # @param [Null] human Value to be assigned + def human=(human) + if human.nil? + fail ArgumentError, 'human cannot be nil' + end + + @human = human + end + + # Custom attribute writer method with validation + # @param [UserServiceMachineUser] machine Value to be assigned + def machine=(machine) + if machine.nil? + fail ArgumentError, 'machine cannot be nil' + end + + @machine = machine + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/zitadel/client/models/user_service_user_name_query.rb b/lib/zitadel/client/models/user_service_user_name_query.rb deleted file mode 100644 index 3e83519a..00000000 --- a/lib/zitadel/client/models/user_service_user_name_query.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Query for users with a specific user name. - class UserServiceUserNameQuery - attr_accessor :user_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_name' => :'userName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUserNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUserNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - else - self.user_name = nil - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - else - self.method = 'TEXT_QUERY_METHOD_EQUALS' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @user_name.nil? - invalid_properties.push('invalid value for "user_name", user_name cannot be nil.') - end - - if @user_name.to_s.length > 200 - invalid_properties.push('invalid value for "user_name", the character length must be smaller than or equal to 200.') - end - - if @user_name.to_s.length < 1 - invalid_properties.push('invalid value for "user_name", the character length must be great than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @user_name.nil? - return false if @user_name.to_s.length > 200 - return false if @user_name.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] user_name Value to be assigned - def user_name=(user_name) - if user_name.nil? - fail ArgumentError, 'user_name cannot be nil' - end - - if user_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "user_name", the character length must be smaller than or equal to 200.' - end - - if user_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "user_name", the character length must be great than or equal to 1.' - end - - @user_name = user_name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_name == o.user_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_value.rb b/lib/zitadel/client/models/user_service_value.rb new file mode 100644 index 00000000..8bf5c0cc --- /dev/null +++ b/lib/zitadel/client/models/user_service_value.rb @@ -0,0 +1,114 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models +# `Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of these variants. Absence of any variant indicates an error. The JSON representation for `Value` is JSON value. +module UserServiceValue + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'Boolean', + :'Float', + :'Hash', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass_name| + begin + next if klass_name == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass_name, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass_name, data) + return if data.nil? + + case klass_name.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type.to_sym, item) } # MODIFIED: ensure sub_type is symbol for recursive call + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type.to_sym, v) } # MODIFIED: ensure sub_type is symbol for recursive call + end + else # model + # MODIFIED: Ensure model is looked up in the Models namespace + const = Zitadel::Client::Models.const_get(klass_name) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + # TODO: Consider re-enabling this check if strictly needed, but it might be too restrictive for oneOf. + # raise if const.respond_to?(:acceptable_attributes) && data.is_a?(Hash) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue SchemaMismatchError => e # Specific rescue for re-raising + raise e + rescue # General rescue for other errors during casting/lookup + # MODIFIED: Updated class name in error message to include full namespace context + raise SchemaMismatchError, "#{data.inspect} doesn't match the Zitadel::Client::Models::#{klass_name} type" + end + end +end + +end diff --git a/lib/zitadel/client/models/user_service_verify_email_request.rb b/lib/zitadel/client/models/user_service_verify_email_request.rb index 1dd96760..ec3e4835 100644 --- a/lib/zitadel/client/models/user_service_verify_email_request.rb +++ b/lib/zitadel/client/models/user_service_verify_email_request.rb @@ -15,12 +15,14 @@ module Zitadel::Client::Models class UserServiceVerifyEmailRequest - # \"the verification code generated during the set email request\" + attr_accessor :user_id + attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'verification_code' => :'verificationCode' } end @@ -38,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'verification_code' => :'String' } end @@ -66,6 +69,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + if attributes.key?(:'verification_code') self.verification_code = attributes[:'verification_code'] else @@ -78,16 +87,12 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @verification_code.nil? - invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') - end - - if @verification_code.to_s.length > 20 - invalid_properties.push('invalid value for "verification_code", the character length must be smaller than or equal to 20.') + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end - if @verification_code.to_s.length < 1 - invalid_properties.push('invalid value for "verification_code", the character length must be great than or equal to 1.') + if @verification_code.nil? + invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') end invalid_properties @@ -97,25 +102,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? return false if @verification_code.nil? - return false if @verification_code.to_s.length > 20 - return false if @verification_code.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] verification_code Value to be assigned - def verification_code=(verification_code) - if verification_code.nil? - fail ArgumentError, 'verification_code cannot be nil' + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' end - if verification_code.to_s.length > 20 - fail ArgumentError, 'invalid value for "verification_code", the character length must be smaller than or equal to 20.' - end + @user_id = user_id + end - if verification_code.to_s.length < 1 - fail ArgumentError, 'invalid value for "verification_code", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] verification_code Value to be assigned + def verification_code=(verification_code) + if verification_code.nil? + fail ArgumentError, 'verification_code cannot be nil' end @verification_code = verification_code @@ -126,6 +132,7 @@ def verification_code=(verification_code) def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && verification_code == o.verification_code end @@ -138,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [verification_code].hash + [user_id, verification_code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_verify_invite_code_request.rb b/lib/zitadel/client/models/user_service_verify_invite_code_request.rb index 4f6dd1b0..638110e4 100644 --- a/lib/zitadel/client/models/user_service_verify_invite_code_request.rb +++ b/lib/zitadel/client/models/user_service_verify_invite_code_request.rb @@ -15,12 +15,14 @@ module Zitadel::Client::Models class UserServiceVerifyInviteCodeRequest - # \"the verification code generated during the invite code request\" + attr_accessor :user_id + attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'verification_code' => :'verificationCode' } end @@ -38,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'verification_code' => :'String' } end @@ -66,6 +69,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + if attributes.key?(:'verification_code') self.verification_code = attributes[:'verification_code'] else @@ -78,16 +87,12 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @verification_code.nil? - invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') - end - - if @verification_code.to_s.length > 20 - invalid_properties.push('invalid value for "verification_code", the character length must be smaller than or equal to 20.') + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end - if @verification_code.to_s.length < 1 - invalid_properties.push('invalid value for "verification_code", the character length must be great than or equal to 1.') + if @verification_code.nil? + invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') end invalid_properties @@ -97,25 +102,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? return false if @verification_code.nil? - return false if @verification_code.to_s.length > 20 - return false if @verification_code.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] verification_code Value to be assigned - def verification_code=(verification_code) - if verification_code.nil? - fail ArgumentError, 'verification_code cannot be nil' + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' end - if verification_code.to_s.length > 20 - fail ArgumentError, 'invalid value for "verification_code", the character length must be smaller than or equal to 20.' - end + @user_id = user_id + end - if verification_code.to_s.length < 1 - fail ArgumentError, 'invalid value for "verification_code", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] verification_code Value to be assigned + def verification_code=(verification_code) + if verification_code.nil? + fail ArgumentError, 'verification_code cannot be nil' end @verification_code = verification_code @@ -126,6 +132,7 @@ def verification_code=(verification_code) def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && verification_code == o.verification_code end @@ -138,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [verification_code].hash + [user_id, verification_code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb b/lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb index 59b65487..3e382737 100644 --- a/lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb +++ b/lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb @@ -15,7 +15,11 @@ module Zitadel::Client::Models class UserServiceVerifyPasskeyRegistrationRequest - # PublicKeyCredential Interface. Generated helper methods populate the field from JSON created by a WebauthN client. See also: https://www.w3.org/TR/webauthn/#publickeycredential + attr_accessor :user_id + + attr_accessor :passkey_id + + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. attr_accessor :public_key_credential attr_accessor :passkey_name @@ -23,6 +27,8 @@ class UserServiceVerifyPasskeyRegistrationRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', + :'passkey_id' => :'passkeyId', :'public_key_credential' => :'publicKeyCredential', :'passkey_name' => :'passkeyName' } @@ -41,7 +47,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'public_key_credential' => :'Object', + :'user_id' => :'String', + :'passkey_id' => :'String', + :'public_key_credential' => :'Hash', :'passkey_name' => :'String' } end @@ -70,8 +78,22 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'passkey_id') + self.passkey_id = attributes[:'passkey_id'] + else + self.passkey_id = nil + end + if attributes.key?(:'public_key_credential') - self.public_key_credential = attributes[:'public_key_credential'] + if (value = attributes[:'public_key_credential']).is_a?(Hash) + self.public_key_credential = value + end else self.public_key_credential = nil end @@ -88,20 +110,20 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @public_key_credential.nil? - invalid_properties.push('invalid value for "public_key_credential", public_key_credential cannot be nil.') + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end - if @passkey_name.nil? - invalid_properties.push('invalid value for "passkey_name", passkey_name cannot be nil.') + if @passkey_id.nil? + invalid_properties.push('invalid value for "passkey_id", passkey_id cannot be nil.') end - if @passkey_name.to_s.length > 200 - invalid_properties.push('invalid value for "passkey_name", the character length must be smaller than or equal to 200.') + if @public_key_credential.nil? + invalid_properties.push('invalid value for "public_key_credential", public_key_credential cannot be nil.') end - if @passkey_name.to_s.length < 1 - invalid_properties.push('invalid value for "passkey_name", the character length must be great than or equal to 1.') + if @passkey_name.nil? + invalid_properties.push('invalid value for "passkey_name", passkey_name cannot be nil.') end invalid_properties @@ -111,15 +133,35 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + return false if @passkey_id.nil? return false if @public_key_credential.nil? return false if @passkey_name.nil? - return false if @passkey_name.to_s.length > 200 - return false if @passkey_name.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] public_key_credential Value to be assigned + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] passkey_id Value to be assigned + def passkey_id=(passkey_id) + if passkey_id.nil? + fail ArgumentError, 'passkey_id cannot be nil' + end + + @passkey_id = passkey_id + end + + # Custom attribute writer method with validation + # @param [Hash] public_key_credential Value to be assigned def public_key_credential=(public_key_credential) if public_key_credential.nil? fail ArgumentError, 'public_key_credential cannot be nil' @@ -129,20 +171,12 @@ def public_key_credential=(public_key_credential) end # Custom attribute writer method with validation - # @param [Object] passkey_name Value to be assigned + # @param [String] passkey_name Value to be assigned def passkey_name=(passkey_name) if passkey_name.nil? fail ArgumentError, 'passkey_name cannot be nil' end - if passkey_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "passkey_name", the character length must be smaller than or equal to 200.' - end - - if passkey_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "passkey_name", the character length must be great than or equal to 1.' - end - @passkey_name = passkey_name end @@ -151,6 +185,8 @@ def passkey_name=(passkey_name) def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && + passkey_id == o.passkey_id && public_key_credential == o.public_key_credential && passkey_name == o.passkey_name end @@ -164,7 +200,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [public_key_credential, passkey_name].hash + [user_id, passkey_id, public_key_credential, passkey_name].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_verify_phone_request.rb b/lib/zitadel/client/models/user_service_verify_phone_request.rb index 3ca9780d..d07e6c0d 100644 --- a/lib/zitadel/client/models/user_service_verify_phone_request.rb +++ b/lib/zitadel/client/models/user_service_verify_phone_request.rb @@ -15,12 +15,14 @@ module Zitadel::Client::Models class UserServiceVerifyPhoneRequest - # \"the verification code generated during the set phone request\" + attr_accessor :user_id + attr_accessor :verification_code # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'verification_code' => :'verificationCode' } end @@ -38,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'verification_code' => :'String' } end @@ -66,6 +69,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + if attributes.key?(:'verification_code') self.verification_code = attributes[:'verification_code'] else @@ -78,16 +87,12 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @verification_code.nil? - invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') - end - - if @verification_code.to_s.length > 20 - invalid_properties.push('invalid value for "verification_code", the character length must be smaller than or equal to 20.') + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end - if @verification_code.to_s.length < 1 - invalid_properties.push('invalid value for "verification_code", the character length must be great than or equal to 1.') + if @verification_code.nil? + invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') end invalid_properties @@ -97,25 +102,26 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? return false if @verification_code.nil? - return false if @verification_code.to_s.length > 20 - return false if @verification_code.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] verification_code Value to be assigned - def verification_code=(verification_code) - if verification_code.nil? - fail ArgumentError, 'verification_code cannot be nil' + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' end - if verification_code.to_s.length > 20 - fail ArgumentError, 'invalid value for "verification_code", the character length must be smaller than or equal to 20.' - end + @user_id = user_id + end - if verification_code.to_s.length < 1 - fail ArgumentError, 'invalid value for "verification_code", the character length must be great than or equal to 1.' + # Custom attribute writer method with validation + # @param [String] verification_code Value to be assigned + def verification_code=(verification_code) + if verification_code.nil? + fail ArgumentError, 'verification_code cannot be nil' end @verification_code = verification_code @@ -126,6 +132,7 @@ def verification_code=(verification_code) def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && verification_code == o.verification_code end @@ -138,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [verification_code].hash + [user_id, verification_code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_request.rb b/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_request.rb index f1774297..1b515bc2 100644 --- a/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_request.rb +++ b/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_request.rb @@ -15,12 +15,14 @@ module Zitadel::Client::Models class UserServiceVerifyTOTPRegistrationRequest - # Code generated by TOTP app or device + attr_accessor :user_id + attr_accessor :code # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', :'code' => :'code' } end @@ -38,6 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'user_id' => :'String', :'code' => :'String' } end @@ -66,6 +69,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + if attributes.key?(:'code') self.code = attributes[:'code'] else @@ -78,6 +87,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + if @code.nil? invalid_properties.push('invalid value for "code", code cannot be nil.') end @@ -89,12 +102,23 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? return false if @code.nil? true end # Custom attribute writer method with validation - # @param [Object] code Value to be assigned + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] code Value to be assigned def code=(code) if code.nil? fail ArgumentError, 'code cannot be nil' @@ -108,6 +132,7 @@ def code=(code) def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && code == o.code end @@ -120,7 +145,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code].hash + [user_id, code].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb b/lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb index 22acce0a..417d6a06 100644 --- a/lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb +++ b/lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb @@ -15,7 +15,11 @@ module Zitadel::Client::Models class UserServiceVerifyU2FRegistrationRequest - # PublicKeyCredential Interface. Generated helper methods populate the field from JSON created by a WebauthN client. See also: https://www.w3.org/TR/webauthn/#publickeycredential + attr_accessor :user_id + + attr_accessor :u2f_id + + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. attr_accessor :public_key_credential attr_accessor :token_name @@ -23,6 +27,8 @@ class UserServiceVerifyU2FRegistrationRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'user_id' => :'userId', + :'u2f_id' => :'u2fId', :'public_key_credential' => :'publicKeyCredential', :'token_name' => :'tokenName' } @@ -41,7 +47,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'public_key_credential' => :'Object', + :'user_id' => :'String', + :'u2f_id' => :'String', + :'public_key_credential' => :'Hash', :'token_name' => :'String' } end @@ -70,8 +78,22 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + else + self.user_id = nil + end + + if attributes.key?(:'u2f_id') + self.u2f_id = attributes[:'u2f_id'] + else + self.u2f_id = nil + end + if attributes.key?(:'public_key_credential') - self.public_key_credential = attributes[:'public_key_credential'] + if (value = attributes[:'public_key_credential']).is_a?(Hash) + self.public_key_credential = value + end else self.public_key_credential = nil end @@ -88,20 +110,20 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @public_key_credential.nil? - invalid_properties.push('invalid value for "public_key_credential", public_key_credential cannot be nil.') + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end - if @token_name.nil? - invalid_properties.push('invalid value for "token_name", token_name cannot be nil.') + if @u2f_id.nil? + invalid_properties.push('invalid value for "u2f_id", u2f_id cannot be nil.') end - if @token_name.to_s.length > 200 - invalid_properties.push('invalid value for "token_name", the character length must be smaller than or equal to 200.') + if @public_key_credential.nil? + invalid_properties.push('invalid value for "public_key_credential", public_key_credential cannot be nil.') end - if @token_name.to_s.length < 1 - invalid_properties.push('invalid value for "token_name", the character length must be great than or equal to 1.') + if @token_name.nil? + invalid_properties.push('invalid value for "token_name", token_name cannot be nil.') end invalid_properties @@ -111,15 +133,35 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user_id.nil? + return false if @u2f_id.nil? return false if @public_key_credential.nil? return false if @token_name.nil? - return false if @token_name.to_s.length > 200 - return false if @token_name.to_s.length < 1 true end # Custom attribute writer method with validation - # @param [Object] public_key_credential Value to be assigned + # @param [String] user_id Value to be assigned + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'user_id cannot be nil' + end + + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param [String] u2f_id Value to be assigned + def u2f_id=(u2f_id) + if u2f_id.nil? + fail ArgumentError, 'u2f_id cannot be nil' + end + + @u2f_id = u2f_id + end + + # Custom attribute writer method with validation + # @param [Hash] public_key_credential Value to be assigned def public_key_credential=(public_key_credential) if public_key_credential.nil? fail ArgumentError, 'public_key_credential cannot be nil' @@ -129,20 +171,12 @@ def public_key_credential=(public_key_credential) end # Custom attribute writer method with validation - # @param [Object] token_name Value to be assigned + # @param [String] token_name Value to be assigned def token_name=(token_name) if token_name.nil? fail ArgumentError, 'token_name cannot be nil' end - if token_name.to_s.length > 200 - fail ArgumentError, 'invalid value for "token_name", the character length must be smaller than or equal to 200.' - end - - if token_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "token_name", the character length must be great than or equal to 1.' - end - @token_name = token_name end @@ -151,6 +185,8 @@ def token_name=(token_name) def ==(o) return true if self.equal?(o) self.class == o.class && + user_id == o.user_id && + u2f_id == o.u2f_id && public_key_credential == o.public_key_credential && token_name == o.token_name end @@ -164,7 +200,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [public_key_credential, token_name].hash + [user_id, u2f_id, public_key_credential, token_name].hash end # Builds the object from hash diff --git a/lib/zitadel/client/models/verification_code.rb b/lib/zitadel/client/models/verification_code.rb new file mode 100644 index 00000000..a1c261fc --- /dev/null +++ b/lib/zitadel/client/models/verification_code.rb @@ -0,0 +1,247 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class VerificationCode + attr_accessor :verification_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'verification_code' => :'verificationCode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'verification_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::VerificationCode` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::VerificationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'verification_code') + self.verification_code = attributes[:'verification_code'] + else + self.verification_code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @verification_code.nil? + invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @verification_code.nil? + true + end + + # Custom attribute writer method with validation + # @param [String] verification_code Value to be assigned + def verification_code=(verification_code) + if verification_code.nil? + fail ArgumentError, 'verification_code cannot be nil' + end + + @verification_code = verification_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + verification_code == o.verification_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [verification_code].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end +end + + end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_r_s_a_hasher.rb b/lib/zitadel/client/models/web_key_service_beta_r_s_a_hasher.rb deleted file mode 100644 index 69c484f8..00000000 --- a/lib/zitadel/client/models/web_key_service_beta_r_s_a_hasher.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class WebKeyServiceBetaRSAHasher - RSA_HASHER_UNSPECIFIED = "RSA_HASHER_UNSPECIFIED".freeze - RSA_HASHER_SHA256 = "RSA_HASHER_SHA256".freeze - RSA_HASHER_SHA384 = "RSA_HASHER_SHA384".freeze - RSA_HASHER_SHA512 = "RSA_HASHER_SHA512".freeze - - def self.all_vars - @all_vars ||= [RSA_HASHER_UNSPECIFIED, RSA_HASHER_SHA256, RSA_HASHER_SHA384, RSA_HASHER_SHA512].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if WebKeyServiceBetaRSAHasher.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaRSAHasher" - end - end - -end diff --git a/lib/zitadel/client/zitadel.rb b/lib/zitadel/client/zitadel.rb index 1c7cced0..2053248f 100644 --- a/lib/zitadel/client/zitadel.rb +++ b/lib/zitadel/client/zitadel.rb @@ -6,6 +6,7 @@ module Client # # Initializes and configures the SDK with the provided authentication strategy. # Sets up service APIs for interacting with various Zitadel features. + # noinspection RubyTooManyInstanceVariablesInspection class Zitadel attr_reader :actions, :features, @@ -29,7 +30,7 @@ def initialize(authenticator) client = ApiClient.new(@configuration) - @actions = Api::ActionServiceApi.new(client) + @actions = Api::BetaActionServiceApi.new(client) @features = Api::FeatureServiceApi.new(client) @idps = Api::IdentityProviderServiceApi.new(client) @oidc = Api::OIDCServiceApi.new(client) @@ -38,7 +39,7 @@ def initialize(authenticator) @sessions = Api::SessionServiceApi.new(client) @settings = Api::SettingsServiceApi.new(client) @users = Api::UserServiceApi.new(client) - @webkeys = Api::WebKeyServiceApi.new(client) + @webkeys = Api::BetaWebKeyServiceApi.new(client) end # rubocop:enable Metrics/MethodLength, Metrics/AbcSize diff --git a/spec/auth/use_access_token_spec.rb b/spec/auth/use_access_token_spec.rb index e8e621ba..282d0d78 100644 --- a/spec/auth/use_access_token_spec.rb +++ b/spec/auth/use_access_token_spec.rb @@ -25,7 +25,7 @@ it 'retrieves general settings with valid token' do client = zitadel_client - client.settings.settings_service_get_general_settings + client.settings.get_general_settings({}) end it 'raises an ApiError with invalid token' do @@ -34,7 +34,7 @@ 'invalid' ) assert_raises(Zitadel::Client::ZitadelError) do - client.settings.settings_service_get_general_settings + client.settings.get_general_settings({}) end end end diff --git a/spec/auth/use_client_credentials_spec.rb b/spec/auth/use_client_credentials_spec.rb index 22d3e8b3..402edbd6 100644 --- a/spec/auth/use_client_credentials_spec.rb +++ b/spec/auth/use_client_credentials_spec.rb @@ -27,7 +27,7 @@ it 'retrieves general settings with valid credentials' do client = zitadel_client - client.settings.settings_service_get_general_settings + client.settings.get_general_settings({}) end it 'raises an ApiError with invalid credentials' do @@ -37,7 +37,7 @@ 'invalid' ) assert_raises(Zitadel::Client::ZitadelError) do - client.settings.settings_service_get_general_settings + client.settings.get_general_settings({}) end end end diff --git a/spec/auth/use_private_key_spec.rb b/spec/auth/use_private_key_spec.rb index 490ae015..0003546d 100644 --- a/spec/auth/use_private_key_spec.rb +++ b/spec/auth/use_private_key_spec.rb @@ -32,7 +32,7 @@ it 'retrieves general settings with valid private key' do client = zitadel_client - client.settings.settings_service_get_general_settings + client.settings.get_general_settings({}) end it 'raises an ApiError with invalid private key' do @@ -41,7 +41,7 @@ jwt_file.path ) assert_raises(Zitadel::Client::ZitadelError) do - client.settings.settings_service_get_general_settings + client.settings.get_general_settings({}) end end end diff --git a/spec/check_session_service_spec.rb b/spec/check_session_service_spec.rb index 10effab6..44b1565a 100644 --- a/spec/check_session_service_spec.rb +++ b/spec/check_session_service_spec.rb @@ -35,49 +35,41 @@ ), lifetime: '18000s' ) - resp = client.sessions.session_service_create_session(req) + resp = client.sessions.create_session(req) @session_id = resp.session_id @session_token = resp.session_token end after do - delete_req = Zitadel::Client::Models::SessionServiceDeleteSessionRequest.new - begin - client.sessions.session_service_delete_session(@session_id, delete_req) - rescue StandardError - # Ignore cleanup errors - end + request = Zitadel::Client::Models::SessionServiceDeleteSessionRequest.new(session_id: @session_id) + client.sessions.delete_session(request) + rescue StandardError + # Ignore cleanup errors end it 'retrieves the session details by the session identifier' do - response = client.sessions.session_service_get_session( - @session_id, - session_token: @session_token - ) + request = Zitadel::Client::Models::SessionServiceGetSessionRequest.new(session_id: @session_id, session_token: @session_token) + response = client.sessions.get_session(request) _(response.session.id).must_equal @session_id end it 'raises an error when retrieving a non-existent session' do + request = Zitadel::Client::Models::SessionServiceGetSessionRequest.new(session_id: SecureRandom.uuid, + session_token: @session_token) assert_raises(Zitadel::Client::ApiError) do - client.sessions.session_service_get_session( - SecureRandom.uuid, - session_token: @session_token - ) + client.sessions.get_session(request) end end it 'includes the created session when listing all sessions' do request = Zitadel::Client::Models::SessionServiceListSessionsRequest.new(queries: []) - response = client.sessions.session_service_list_sessions(request) + response = client.sessions.list_sessions(request) _(response.sessions.map(&:id)).must_include @session_id end it 'updates the session lifetime and returns a new token' do - request = Zitadel::Client::Models::SessionServiceSetSessionRequest.new(lifetime: '36000s') - response = client.sessions.session_service_set_session( - @session_id, - request - ) + request = Zitadel::Client::Models::SessionServiceSetSessionRequest.new(session_id: @session_id, lifetime: '36000s') + response = client.sessions.set_session(request) _(response.session_token).must_be_instance_of String end end diff --git a/spec/check_user_service_spec.rb b/spec/check_user_service_spec.rb index 6ad4f4dd..c6d8951f 100644 --- a/spec/check_user_service_spec.rb +++ b/spec/check_user_service_spec.rb @@ -40,40 +40,41 @@ ) ) - @user = client.users.user_service_add_human_user(request) + @user = client.users.add_human_user(request) end after do - client.users.user_service_delete_user(@user.user_id) + client.users.delete_user(UserServiceDeleteUserRequest.new(user_id: @user.user_id)) rescue StandardError # Ignore cleanup errors end it 'retrieves the user details by ID' do - response = client.users.user_service_get_user_by_id(@user.user_id) + response = client.users.get_user_by_id(UserServiceGetUserByIDRequest.new(user_id: @user.user_id)) _(response.user.user_id).must_equal @user.user_id end it 'raises an error when retrieving a non-existent user' do assert_raises(Zitadel::Client::ApiError) do - client.users.user_service_get_user_by_id(SecureRandom.uuid) + client.users.get_user_by_id(UserServiceGetUserByIDRequest.new(user_id: SecureRandom.uuid)) end end it 'includes the created user when listing all users' do request = Zitadel::Client::Models::UserServiceListUsersRequest.new(queries: []) - response = client.users.user_service_list_users(request) + response = client.users.list_users(request) _(response.result.map(&:user_id)).must_include @user.user_id end it "updates the user's email and reflects the change" do new_email = "updated#{SecureRandom.hex}@example.com" update_req = Zitadel::Client::Models::UserServiceUpdateHumanUserRequest.new( + user_id: @user.user_id, email: Zitadel::Client::Models::UserServiceSetHumanEmail.new(email: new_email) ) - client.users.user_service_update_human_user(@user.user_id, update_req) + client.users.update_human_user(update_req) - response = client.users.user_service_get_user_by_id(@user.user_id) + response = client.users.get_user_by_id(UserServiceGetUserByIDRequest.new(user_id: @user.user_id)) _(response.user.human.email.email).must_equal new_email end end