diff --git a/lib/zitadel/client/api/action_service_api.rb b/lib/zitadel/client/api/action_service_api.rb new file mode 100644 index 00000000..87aaa3a1 --- /dev/null +++ b/lib/zitadel/client/api/action_service_api.rb @@ -0,0 +1,670 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the 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/settings_api.rb b/lib/zitadel/client/api/settings_api.rb deleted file mode 100644 index 68086a96..00000000 --- a/lib/zitadel/client/api/settings_api.rb +++ /dev/null @@ -1,147 +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 SettingsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Get Security Settings - # Returns the security settings of the ZITADEL instance. - # @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) - data - end - - # Get Security Settings - # Returns the security settings of the ZITADEL instance. - # @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 = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsApi.settings_service_get_security_settings ...' # MODIFIED - end - # resource path - local_var_path = '/v2/settings/security' - - # 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] || 'SettingsServiceGetSecuritySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsApi.settings_service_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(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsApi#settings_service_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. - # @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) - data - end - - # Set Security Settings - # Set the security settings of the ZITADEL instance. - # @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 = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsApi.settings_service_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::SettingsApi.settings_service_set_security_settings" # MODIFIED - end - # resource path - local_var_path = '/v2/policies/security' - - # 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(settings_service_set_security_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceSetSecuritySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsApi.settings_service_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(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsApi#settings_service_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/settings_service_api.rb b/lib/zitadel/client/api/settings_service_api.rb index 09b902bd..4cc7b6c1 100644 --- a/lib/zitadel/client/api/settings_service_api.rb +++ b/lib/zitadel/client/api/settings_service_api.rb @@ -590,6 +590,131 @@ def settings_service_get_password_expiry_settings_with_http_info(opts = {}) @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 end return data, status_code, headers + end + + # Get Security Settings + # Returns the security settings of the ZITADEL instance. + # @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) + data + end + + # Get Security Settings + # Returns the security settings of the ZITADEL instance. + # @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 = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_get_security_settings ...' # MODIFIED + end + # resource path + local_var_path = '/v2/settings/security' + + # 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] || 'SettingsServiceGetSecuritySettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::SettingsServiceApi.settings_service_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(:GET, 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 + end + return data, status_code, headers + end + + # Set Security Settings + # Set the security settings of the ZITADEL instance. + # @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) + data + end + + # Set Security Settings + # Set the security settings of the ZITADEL instance. + # @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 = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.settings_service_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 + end + # resource path + local_var_path = '/v2/policies/security' + + # 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(settings_service_set_security_settings_request) + + # return_type + return_type = opts[:debug_return_type] || 'SettingsServiceSetSecuritySettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] + + new_options = opts.merge( + :operation => :"Api::SettingsServiceApi.settings_service_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(:PUT, 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 + end + return data, status_code, headers end end end diff --git a/lib/zitadel/client/api/web_key_service_api.rb b/lib/zitadel/client/api/web_key_service_api.rb new file mode 100644 index 00000000..d915ea69 --- /dev/null +++ b/lib/zitadel/client/api/web_key_service_api.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 '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_condition.rb b/lib/zitadel/client/models/action_service_beta_condition.rb new file mode 100644 index 00000000..00189813 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_condition.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 ActionServiceBetaCondition + attr_accessor :request + + attr_accessor :response + + attr_accessor :function + + attr_accessor :event + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request' => :'request', + :'response' => :'response', + :'function' => :'function', + :'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 + { + :'request' => :'ActionServiceBetaRequestExecution', + :'response' => :'ActionServiceBetaResponseExecution', + :'function' => :'ActionServiceBetaFunctionExecution', + :'event' => :'ActionServiceBetaEventExecution' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'request') + self.request = attributes[:'request'] + end + + if attributes.key?(:'response') + self.response = attributes[:'response'] + end + + if attributes.key?(:'function') + self.function = attributes[:'function'] + end + + if attributes.key?(:'event') + self.event = attributes[:'event'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + request == o.request && + response == o.response && + function == o.function && + 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 + [request, response, function, 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/action_service_beta_create_target_response.rb b/lib/zitadel/client/models/action_service_beta_create_target_response.rb new file mode 100644 index 00000000..bd5ecf14 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_create_target_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 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'creation_date' => :'creationDate', + :'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 + { + :'id' => :'String', + :'creation_date' => :'Time', + :'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::ActionServiceBetaCreateTargetResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + 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 + [id, creation_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/action_service_beta_delete_target_response.rb b/lib/zitadel/client/models/action_service_beta_delete_target_response.rb new file mode 100644 index 00000000..d86214ef --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_delete_target_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 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. + 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::ActionServiceBetaDeleteTargetResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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/action_service_beta_event_execution.rb b/lib/zitadel/client/models/action_service_beta_event_execution.rb new file mode 100644 index 00000000..b199abc7 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_event_execution.rb @@ -0,0 +1,307 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 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_execution.rb b/lib/zitadel/client/models/action_service_beta_execution.rb new file mode 100644 index 00000000..42b6fc04 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_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 ActionServiceBetaExecution + attr_accessor :condition + + # The timestamp of the execution creation. + attr_accessor :creation_date + + # The timestamp of the last change to the execution. + attr_accessor :change_date + + # Ordered list of targets/includes 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' => :'ActionServiceBetaCondition', + :'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::ActionServiceBetaExecution` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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/action_service_beta_execution_target_type.rb b/lib/zitadel/client/models/action_service_beta_execution_target_type.rb new file mode 100644 index 00000000..80c33ebc --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_execution_target_type.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 ActionServiceBetaExecutionTargetType + # Unique identifier of existing target to call. + attr_accessor :target + + attr_accessor :include + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'target' => :'target', + :'include' => :'include' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' => :'String', + :'include' => :'ActionServiceBetaCondition' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceBetaExecutionTargetType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + # MODIFIED: Updated class name in error message + fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceBetaExecutionTargetType`. Please check the 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') + self.target = attributes[:'target'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + target == o.target && + include == o.include + end + + # @see the `==` method + # @param [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, include].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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/action_service_beta_function_execution.rb new file mode 100644 index 00000000..51c5e384 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_function_execution.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 ActionServiceBetaFunctionExecution + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'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 + invalid_properties + end + + # Check to see if the 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 == o.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 + [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/action_service_beta_get_target_response.rb b/lib/zitadel/client/models/action_service_beta_get_target_response.rb new file mode 100644 index 00000000..5e3227a9 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_get_target_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 ActionServiceBetaGetTargetResponse + attr_accessor :target + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'target' => :'target' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' => :'ActionServiceBetaTarget' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + target == o.target + end + + # @see the `==` method + # @param [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].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_in_target_i_ds_filter.rb b/lib/zitadel/client/models/action_service_beta_in_target_i_ds_filter.rb new file mode 100644 index 00000000..4522325d --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_in_target_i_ds_filter.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 + class ActionServiceBetaInTargetIDsFilter + # the ids of the targets to include + attr_accessor :target_ids + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'target_ids' => :'targetIds' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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_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::ActionServiceBetaInTargetIDsFilter` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'target_ids') + if (value = attributes[:'target_ids']).is_a?(Array) + self.target_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 && + target_ids == o.target_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 + [target_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/action_service_beta_list_execution_functions_response.rb b/lib/zitadel/client/models/action_service_beta_list_execution_functions_response.rb new file mode 100644 index 00000000..469086e5 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_list_execution_functions_response.rb @@ -0,0 +1,232 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ActionServiceBetaListExecutionFunctionsResponse + attr_accessor :functions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'functions' => :'functions' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'functions' => :'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::ActionServiceBetaListExecutionFunctionsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'functions') + if (value = attributes[:'functions']).is_a?(Array) + self.functions = 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 && + functions == o.functions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [functions].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_execution_methods_response.rb b/lib/zitadel/client/models/action_service_beta_list_execution_methods_response.rb new file mode 100644 index 00000000..3e6fb174 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_list_execution_methods_response.rb @@ -0,0 +1,232 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ActionServiceBetaListExecutionMethodsResponse + attr_accessor :methods + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'methods' => :'methods' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'methods' => :'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::ActionServiceBetaListExecutionMethodsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'methods') + if (value = attributes[:'methods']).is_a?(Array) + self.methods = 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 && + methods == o.methods + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [methods].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_execution_services_response.rb b/lib/zitadel/client/models/action_service_beta_list_execution_services_response.rb new file mode 100644 index 00000000..a00b995a --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_list_execution_services_response.rb @@ -0,0 +1,232 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ActionServiceBetaListExecutionServicesResponse + attr_accessor :services + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'services' => :'services' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'services' => :'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::ActionServiceBetaListExecutionServicesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = 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 && + services == o.services + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [services].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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/action_service_beta_list_executions_response.rb new file mode 100644 index 00000000..b8972fa2 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_list_executions_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 ActionServiceBetaListExecutionsResponse + attr_accessor :pagination + + attr_accessor :result + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'result' => :'result' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' => :'ActionServiceBetaPaginationResponse', + :'result' => :'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::ActionServiceBetaListExecutionsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'result') + if (value = attributes[:'result']).is_a?(Array) + self.result = 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 && + result == o.result + end + + # @see the `==` method + # @param [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, result].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_targets_response.rb b/lib/zitadel/client/models/action_service_beta_list_targets_response.rb new file mode 100644 index 00000000..980c2bc0 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_list_targets_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 ActionServiceBetaListTargetsResponse + attr_accessor :pagination + + attr_accessor :result + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'result' => :'result' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' => :'ActionServiceBetaPaginationResponse', + :'result' => :'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::ActionServiceBetaListTargetsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'result') + if (value = attributes[:'result']).is_a?(Array) + self.result = 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 && + result == o.result + end + + # @see the `==` method + # @param [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, result].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_pagination_request.rb b/lib/zitadel/client/models/action_service_beta_pagination_request.rb new file mode 100644 index 00000000..c0c7142e --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_pagination_request.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 ActionServiceBetaPaginationRequest + # 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. + 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. + 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' => :'String', + :'limit' => :'Integer', + :'asc' => :'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::ActionServiceBetaPaginationRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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/action_service_beta_pagination_response.rb b/lib/zitadel/client/models/action_service_beta_pagination_response.rb new file mode 100644 index 00000000..1cbd0f72 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_pagination_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 ActionServiceBetaPaginationResponse + # Absolute number of objects matching the query, regardless of applied limit. + attr_accessor :total_result + + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + attr_accessor :applied_limit + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'total_result' => :'totalResult', + :'applied_limit' => :'appliedLimit' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' => :'String', + :'applied_limit' => :'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::ActionServiceBetaPaginationResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'total_result') + self.total_result = attributes[:'total_result'] + end + + if attributes.key?(:'applied_limit') + self.applied_limit = attributes[:'applied_limit'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + applied_limit == o.applied_limit + end + + # @see the `==` method + # @param [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, applied_limit].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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/action_service_beta_r_e_s_t_call.rb new file mode 100644 index 00000000..1e035b0b --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_r_e_s_t_call.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 ActionServiceBetaRESTCall + # Define if any error stops the whole execution. By default the process continues as normal. + attr_accessor :interrupt_on_error + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'interrupt_on_error' => :'interruptOnError' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'interrupt_on_error' => :'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::ActionServiceBetaRESTCall` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'interrupt_on_error') + self.interrupt_on_error = attributes[:'interrupt_on_error'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + interrupt_on_error == o.interrupt_on_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 + [interrupt_on_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/action_service_beta_r_e_s_t_webhook.rb b/lib/zitadel/client/models/action_service_beta_r_e_s_t_webhook.rb new file mode 100644 index 00000000..b240b3ff --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_r_e_s_t_webhook.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 ActionServiceBetaRESTWebhook + # Define if any error stops the whole execution. By default the process continues as normal. + attr_accessor :interrupt_on_error + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'interrupt_on_error' => :'interruptOnError' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'interrupt_on_error' => :'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::ActionServiceBetaRESTWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'interrupt_on_error') + self.interrupt_on_error = attributes[:'interrupt_on_error'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + interrupt_on_error == o.interrupt_on_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 + [interrupt_on_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/action_service_beta_request_execution.rb b/lib/zitadel/client/models/action_service_beta_request_execution.rb new file mode 100644 index 00000000..6ad3094d --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_request_execution.rb @@ -0,0 +1,307 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ActionServiceBetaRequestExecution + # GRPC-method as condition. + attr_accessor :method + + # GRPC-service as condition. + attr_accessor :service + + # All calls to any available services and methods as condition. + attr_accessor :all + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'method' => :'method', + :'service' => :'service', + :'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 + { + :'method' => :'String', + :'service' => :'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::ActionServiceBetaRequestExecution` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'method') + self.method = attributes[:'method'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + 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 !@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.') + 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.') + 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.') + 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.') + 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' + 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 + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [method, service, 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_response_execution.rb b/lib/zitadel/client/models/action_service_beta_response_execution.rb new file mode 100644 index 00000000..f360a029 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_response_execution.rb @@ -0,0 +1,307 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ActionServiceBetaResponseExecution + # GRPC-method as condition. + attr_accessor :method + + # GRPC-service as condition. + attr_accessor :service + + # All calls to any available services and methods as condition. + attr_accessor :all + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'method' => :'method', + :'service' => :'service', + :'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 + { + :'method' => :'String', + :'service' => :'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::ActionServiceBetaResponseExecution` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'method') + self.method = attributes[:'method'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + 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 !@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.') + 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.') + 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.') + 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.') + 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' + 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 + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [method, service, 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_set_execution_response.rb b/lib/zitadel/client/models/action_service_beta_set_execution_response.rb new file mode 100644 index 00000000..f1ce19ba --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_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 ActionServiceBetaSetExecutionResponse + # The timestamp of the execution set. + 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::ActionServiceBetaSetExecutionResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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/action_service_beta_target.rb b/lib/zitadel/client/models/action_service_beta_target.rb new file mode 100644 index 00000000..03d8a74a --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_target.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 ActionServiceBetaTarget + # The unique identifier of the target. + attr_accessor :id + + # The timestamp of the target creation. + 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 + + attr_accessor :signing_key + + # Attribute mapping from ruby-style variable name to JSON key. + 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 + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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', + :'name' => :'String', + :'rest_webhook' => :'ActionServiceBetaRESTWebhook', + :'rest_call' => :'ActionServiceBetaRESTCall', + :'rest_async' => :'Object', + :'timeout' => :'String', + :'endpoint' => :'String', + :'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::ActionServiceBetaTarget` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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?(:'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 + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + 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 + + # @see the `==` method + # @param [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, name, rest_webhook, rest_call, rest_async, timeout, endpoint, 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/action_service_beta_target_field_name.rb b/lib/zitadel/client/models/action_service_beta_target_field_name.rb new file mode 100644 index 00000000..e2a98ce4 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_target_field_name.rb @@ -0,0 +1,48 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ActionServiceBetaTargetFieldName + 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 + TARGET_FIELD_NAME_CHANGED_DATE = "TARGET_FIELD_NAME_CHANGED_DATE".freeze + TARGET_FIELD_NAME_NAME = "TARGET_FIELD_NAME_NAME".freeze + TARGET_FIELD_NAME_TARGET_TYPE = "TARGET_FIELD_NAME_TARGET_TYPE".freeze + TARGET_FIELD_NAME_URL = "TARGET_FIELD_NAME_URL".freeze + TARGET_FIELD_NAME_TIMEOUT = "TARGET_FIELD_NAME_TIMEOUT".freeze + TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = "TARGET_FIELD_NAME_INTERRUPT_ON_ERROR".freeze + + def self.all_vars + @all_vars ||= [TARGET_FIELD_NAME_UNSPECIFIED, TARGET_FIELD_NAME_ID, TARGET_FIELD_NAME_CREATED_DATE, TARGET_FIELD_NAME_CHANGED_DATE, TARGET_FIELD_NAME_NAME, TARGET_FIELD_NAME_TARGET_TYPE, TARGET_FIELD_NAME_URL, TARGET_FIELD_NAME_TIMEOUT, TARGET_FIELD_NAME_INTERRUPT_ON_ERROR].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 ActionServiceBetaTargetFieldName.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServiceBetaTargetFieldName" + end + end + +end diff --git a/lib/zitadel/client/models/action_service_beta_target_name_filter.rb b/lib/zitadel/client/models/action_service_beta_target_name_filter.rb new file mode 100644 index 00000000..3b6d0565 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_target_name_filter.rb @@ -0,0 +1,283 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ActionServiceBetaTargetNameFilter + # Defines the name of the target to query for. + attr_accessor :target_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 + { + :'target_name' => :'targetName', + :'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 + { + :'target_name' => :'String', + :'method' => :'ActionServiceBetaTextFilterMethod' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'target_name') + self.target_name = attributes[:'target_name'] + end + + if attributes.key?(:'method') + self.method = attributes[:'method'] + else + self.method = 'TEXT_FILTER_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 !@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.') + 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.nil? && @target_name.to_s.length > 200 + 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.' + end + + @target_name = target_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 && + target_name == o.target_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 + [target_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/action_service_beta_target_search_filter.rb b/lib/zitadel/client/models/action_service_beta_target_search_filter.rb new file mode 100644 index 00000000..5c7a9841 --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_target_search_filter.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 ActionServiceBetaTargetSearchFilter + attr_accessor :target_name_filter + + 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 + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' => :'ActionServiceBetaTargetNameFilter', + :'in_target_ids_filter' => :'ActionServiceBetaInTargetIDsFilter' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + target_name_filter == o.target_name_filter && + in_target_ids_filter == o.in_target_ids_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, in_target_ids_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_text_filter_method.rb b/lib/zitadel/client/models/action_service_beta_text_filter_method.rb new file mode 100644 index 00000000..e4dfe39c --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_text_filter_method.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 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_beta_update_target_response.rb b/lib/zitadel/client/models/action_service_beta_update_target_response.rb new file mode 100644 index 00000000..5d92e82d --- /dev/null +++ b/lib/zitadel/client/models/action_service_beta_update_target_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 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 + + # 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([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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/action_service_create_target_request.rb b/lib/zitadel/client/models/action_service_create_target_request.rb new file mode 100644 index 00000000..d546bb8c --- /dev/null +++ b/lib/zitadel/client/models/action_service_create_target_request.rb @@ -0,0 +1,332 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +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 + + # 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' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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 + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 + end + + # @see the `==` method + # @param [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].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_list_targets_request.rb b/lib/zitadel/client/models/action_service_list_targets_request.rb new file mode 100644 index 00000000..bfd900d3 --- /dev/null +++ b/lib/zitadel/client/models/action_service_list_targets_request.rb @@ -0,0 +1,275 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class ActionServiceListTargetsRequest + 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' => :'ActionServiceBetaPaginationRequest', + :'sorting_column' => :'ActionServiceBetaTargetFieldName', + :'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::ActionServiceListTargetsRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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'] + else + self.sorting_column = 'TARGET_FIELD_NAME_UNSPECIFIED' + 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_protobuf_any.rb b/lib/zitadel/client/models/action_service_protobuf_any.rb new file mode 100644 index 00000000..6d6c2ac2 --- /dev/null +++ b/lib/zitadel/client/models/action_service_protobuf_any.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 ActionServiceProtobufAny + 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::ActionServiceProtobufAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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/action_service_rpc_status.rb b/lib/zitadel/client/models/action_service_rpc_status.rb new file mode 100644 index 00000000..869834b9 --- /dev/null +++ b/lib/zitadel/client/models/action_service_rpc_status.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 ActionServiceRpcStatus + attr_accessor :code + + attr_accessor :message + + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'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 + { + :'code' => :'Integer', + :'message' => :'String', + :'details' => :'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::ActionServiceRpcStatus` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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 + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + code == o.code && + message == o.message && + 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 + [code, message, 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_set_execution_request.rb b/lib/zitadel/client/models/action_service_set_execution_request.rb new file mode 100644 index 00000000..ce93f48d --- /dev/null +++ b/lib/zitadel/client/models/action_service_set_execution_request.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 ActionServiceSetExecutionRequest + attr_accessor :condition + + # Ordered list of targets/includes called during the execution. + attr_accessor :targets + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'condition' => :'condition', + :'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' => :'ActionServiceBetaCondition', + :'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::ActionServiceSetExecutionRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'condition') + self.condition = attributes[:'condition'] + 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 && + 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, 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/action_service_update_target_request.rb b/lib/zitadel/client/models/action_service_update_target_request.rb new file mode 100644 index 00000000..efec5a09 --- /dev/null +++ b/lib/zitadel/client/models/action_service_update_target_request.rb @@ -0,0 +1,342 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 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/web_key_service_beta_activate_web_key_response.rb b/lib/zitadel/client/models/web_key_service_beta_activate_web_key_response.rb new file mode 100644 index 00000000..3f3c8a5b --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_activate_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 WebKeyServiceBetaActivateWebKeyResponse + # The timestamp of the activation of the key. + attr_accessor :change_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'change_date' => :'changeDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'change_date') + self.change_date = attributes[:'change_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 && + change_date == o.change_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 + [change_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_create_web_key_response.rb b/lib/zitadel/client/models/web_key_service_beta_create_web_key_response.rb new file mode 100644 index 00000000..01bcd248 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_create_web_key_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 WebKeyServiceBetaCreateWebKeyResponse + # The unique identifier of the newly created key. + 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' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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 + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 + end + + # @see the `==` method + # @param [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].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_delete_web_key_response.rb b/lib/zitadel/client/models/web_key_service_beta_delete_web_key_response.rb new file mode 100644 index 00000000..d70be513 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_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 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 + + # 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::WebKeyServiceBetaDeleteWebKeyResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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_e_c_d_s_a.rb b/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a.rb new file mode 100644 index 00000000..00f8cf5d --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a.rb @@ -0,0 +1,254 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'curve' => :'curve' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'curve' => :'WebKeyServiceBetaECDSACurve' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'curve') + self.curve = attributes[:'curve'] + else + self.curve = 'ECDSA_CURVE_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 + invalid_properties + end + + # Check to see if the 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 && + curve == o.curve + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [curve].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_curve.rb b/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a_curve.rb new file mode 100644 index 00000000..c43309f3 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_e_c_d_s_a_curve.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 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 + + def self.all_vars + @all_vars ||= [ECDSA_CURVE_UNSPECIFIED, ECDSA_CURVE_P256, ECDSA_CURVE_P384, ECDSA_CURVE_P512].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 WebKeyServiceBetaECDSACurve.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaECDSACurve" + end + end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_list_web_keys_response.rb b/lib/zitadel/client/models/web_key_service_beta_list_web_keys_response.rb new file mode 100644 index 00000000..839e2c5d --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_list_web_keys_response.rb @@ -0,0 +1,232 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class WebKeyServiceBetaListWebKeysResponse + attr_accessor :web_keys + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'web_keys' => :'webKeys' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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_keys' => :'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::WebKeyServiceBetaListWebKeysResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'web_keys') + if (value = attributes[:'web_keys']).is_a?(Array) + self.web_keys = 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 && + web_keys == o.web_keys + end + + # @see the `==` method + # @param [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_keys].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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.rb b/lib/zitadel/client/models/web_key_service_beta_r_s_a.rb new file mode 100644 index 00000000..21eb5539 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_r_s_a.rb @@ -0,0 +1,265 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bits' => :'bits', + :'hasher' => :'hasher' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'bits' => :'WebKeyServiceBetaRSABits', + :'hasher' => :'WebKeyServiceBetaRSAHasher' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Models attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.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" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + end + h[k.to_sym] = v + } + + if attributes.key?(:'bits') + self.bits = attributes[:'bits'] + else + self.bits = 'RSA_BITS_UNSPECIFIED' + end + + if attributes.key?(:'hasher') + self.hasher = attributes[:'hasher'] + else + self.hasher = 'RSA_HASHER_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 + invalid_properties + end + + # Check to see if the 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 && + bits == o.bits && + hasher == o.hasher + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [bits, hasher].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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_bits.rb b/lib/zitadel/client/models/web_key_service_beta_r_s_a_bits.rb new file mode 100644 index 00000000..1bfe8682 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_r_s_a_bits.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 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 + + def self.all_vars + @all_vars ||= [RSA_BITS_UNSPECIFIED, RSA_BITS_2048, RSA_BITS_3072, RSA_BITS_4096].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 WebKeyServiceBetaRSABits.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaRSABits" + 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 new file mode 100644 index 00000000..69c484f8 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_r_s_a_hasher.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 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/models/web_key_service_beta_state.rb b/lib/zitadel/client/models/web_key_service_beta_state.rb new file mode 100644 index 00000000..c659505e --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_state.rb @@ -0,0 +1,44 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class WebKeyServiceBetaState + STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze + STATE_INITIAL = "STATE_INITIAL".freeze + STATE_ACTIVE = "STATE_ACTIVE".freeze + STATE_INACTIVE = "STATE_INACTIVE".freeze + STATE_REMOVED = "STATE_REMOVED".freeze + + def self.all_vars + @all_vars ||= [STATE_UNSPECIFIED, STATE_INITIAL, STATE_ACTIVE, STATE_INACTIVE, STATE_REMOVED].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 WebKeyServiceBetaState.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceBetaState" + end + end + +end diff --git a/lib/zitadel/client/models/web_key_service_beta_web_key.rb b/lib/zitadel/client/models/web_key_service_beta_web_key.rb new file mode 100644 index 00000000..8f4e4ce5 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_beta_web_key.rb @@ -0,0 +1,289 @@ +=begin +#Zitadel SDK + +#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Zitadel::Client::Models + class WebKeyServiceBetaWebKey + # The unique identifier of the key. + attr_accessor :id + + # The timestamp of the key creation. + 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' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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', + :'state' => :'WebKeyServiceBetaState', + :'rsa' => :'WebKeyServiceBetaRSA', + :'ecdsa' => :'WebKeyServiceBetaECDSA', + :'ed25519' => :'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::WebKeyServiceBetaWebKey` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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?(:'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? + # @return 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 && + state == o.state && + rsa == o.rsa && + ecdsa == o.ecdsa && + ed25519 == o.ed25519 + end + + # @see the `==` method + # @param [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, state, rsa, ecdsa, ed25519].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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/web_key_service_create_web_key_request.rb new file mode 100644 index 00000000..ac528743 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_create_web_key_request.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 WebKeyServiceCreateWebKeyRequest + attr_accessor :rsa + + attr_accessor :ecdsa + + attr_accessor :ed25519 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'rsa' => :'rsa', + :'ecdsa' => :'ecdsa', + :'ed25519' => :'ed25519' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns 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' => :'WebKeyServiceBetaRSA', + :'ecdsa' => :'WebKeyServiceBetaECDSA', + :'ed25519' => :'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::WebKeyServiceCreateWebKeyRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + rsa == o.rsa && + ecdsa == o.ecdsa && + ed25519 == o.ed25519 + end + + # @see the `==` method + # @param [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, ecdsa, ed25519].hash + end + +# Builds the object from hash +# @param [Hash] attributes Models attributes in the form of hash +# @return [Object] Returns the model itself +def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) # `new` will call the initialize method of the specific model class. +end + +# Deserializes the data based on type +# @param string type Data type +# @param string value Value to be deserialized +# @return [Object] Deserialized data +def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name + # MODIFIED: Ensure model is looked up in the Models namespace + # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") + klass = Zitadel::Client::Models.const_get(type) + # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) + # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) + klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method + else + klass.build_from_hash(value) # For regular models + end + end +end + +# Returns the string representation of the object +# @return [String] String presentation of the object +def to_s + to_hash.to_s +end + +# to_body is an alias to to_hash (backward compatibility) +# @return [Hash] Returns the object in the form of hash +def to_body + to_hash +end + +# Returns the object in the form of hash +# @return [Hash] Returns the object in the form of hash +def to_hash + hash = {} # Calls super.to_hash if parent exists + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash +end + +# Outputs non-array value in the form of hash +# For object, use to_hash. Otherwise, just return the value +# @param [Object] value Any valid value +# @return [Hash] Returns the value in the form of hash +def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(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/web_key_service_protobuf_any.rb new file mode 100644 index 00000000..d3264035 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_protobuf_any.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 WebKeyServiceProtobufAny + 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::WebKeyServiceProtobufAny` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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/web_key_service_rpc_status.rb b/lib/zitadel/client/models/web_key_service_rpc_status.rb new file mode 100644 index 00000000..dea0591d --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_rpc_status.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 WebKeyServiceRpcStatus + attr_accessor :code + + attr_accessor :message + + attr_accessor :details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message', + :'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 + { + :'code' => :'Integer', + :'message' => :'String', + :'details' => :'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::WebKeyServiceRpcStatus` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_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 + 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 + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return 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 && + code == o.code && + message == o.message && + 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 + [code, message, 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/zitadel.rb b/lib/zitadel/client/zitadel.rb index 3e02f1e9..1c7cced0 100644 --- a/lib/zitadel/client/zitadel.rb +++ b/lib/zitadel/client/zitadel.rb @@ -7,19 +7,21 @@ module Client # Initializes and configures the SDK with the provided authentication strategy. # Sets up service APIs for interacting with various Zitadel features. class Zitadel - attr_reader :features, + attr_reader :actions, + :features, :idps, :oidc, :organizations, + :saml, :sessions, :settings, :users, - :saml + :webkeys # Initialize the Zitadel SDK. # # @param authenticator [Authenticator] the authentication strategy to use - # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/MethodLength, Metrics/AbcSize def initialize(authenticator) # noinspection RubyArgCount @configuration = Configuration.new(authenticator) @@ -27,17 +29,19 @@ def initialize(authenticator) client = ApiClient.new(@configuration) + @actions = Api::ActionServiceApi.new(client) @features = Api::FeatureServiceApi.new(client) @idps = Api::IdentityProviderServiceApi.new(client) @oidc = Api::OIDCServiceApi.new(client) @organizations = Api::OrganizationServiceApi.new(client) + @saml = Api::SAMLServiceApi.new(client) @sessions = Api::SessionServiceApi.new(client) @settings = Api::SettingsServiceApi.new(client) @users = Api::UserServiceApi.new(client) - @saml = Api::SAMLServiceApi.new(client) + @webkeys = Api::WebKeyServiceApi.new(client) end - # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/MethodLength, Metrics/AbcSize class << self # @!group Authentication Entry Points diff --git a/sig/lib.rbs b/sig/lib.rbs index d0d40fec..fb40f345 100644 --- a/sig/lib.rbs +++ b/sig/lib.rbs @@ -276,6 +276,7 @@ module Zitadel def self.with_private_key: (String, String) -> Zitadel + attr_reader actions: untyped attr_reader configuration: Configuration attr_reader features: untyped attr_reader idps: untyped @@ -285,6 +286,7 @@ module Zitadel attr_reader sessions: untyped attr_reader settings: untyped attr_reader users: untyped + attr_reader webkeys: untyped def initialize: (Auth::Authenticator) ?{ (Configuration) -> void } -> void