=begin #Svix API #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 1.1.1 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.2.0 =end require 'cgi' module Svix class EventTypeApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create Event Type # Create new or unarchive existing event type. Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. Endpoints filtering on the event type before archival will continue to filter on it. This operation does not preserve the description and schemas. # @param event_type_in [EventTypeIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EventTypeOut] def v1_event_type_create(event_type_in, opts = {}) data, _status_code, _headers = v1_event_type_create_with_http_info(event_type_in, opts) data end # Create Event Type # Create new or unarchive existing event type. Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. Endpoints filtering on the event type before archival will continue to filter on it. This operation does not preserve the description and schemas. # @param event_type_in [EventTypeIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers def v1_event_type_create_with_http_info(event_type_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_create ...' end # verify the required parameter 'event_type_in' is set if @api_client.config.client_side_validation && event_type_in.nil? fail ArgumentError, "Missing the required parameter 'event_type_in' when calling EventTypeApi.v1_event_type_create" end # resource path local_var_path = '/api/v1/event-type/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_in) # return_type return_type = opts[:debug_return_type] || 'EventTypeOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_create", :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: EventTypeApi#v1_event_type_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Event Type # Archive an event type. Endpoints already configured to filter on an event type will continue to do so after archival. However, new messages can not be sent with it and endpoints can not filter on it. An event type can be unarchived with the [create operation](#operation/create_event_type_api_v1_event_type__post). # @param event_type_name [String] The event type's name # @param [Hash] opts the optional parameters # @option opts [Boolean] :expunge By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. (default to false) # @return [nil] def v1_event_type_delete(event_type_name, opts = {}) v1_event_type_delete_with_http_info(event_type_name, opts) nil end # Delete Event Type # Archive an event type. Endpoints already configured to filter on an event type will continue to do so after archival. However, new messages can not be sent with it and endpoints can not filter on it. An event type can be unarchived with the [create operation](#operation/create_event_type_api_v1_event_type__post). # @param event_type_name [String] The event type's name # @param [Hash] opts the optional parameters # @option opts [Boolean] :expunge By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_event_type_delete_with_http_info(event_type_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_delete ...' end # verify the required parameter 'event_type_name' is set if @api_client.config.client_side_validation && event_type_name.nil? fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.v1_event_type_delete" end if @api_client.config.client_side_validation && event_type_name.to_s.length > 256 fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.v1_event_type_delete, the character length must be smaller than or equal to 256.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && event_type_name !~ pattern fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.v1_event_type_delete, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'expunge'] = opts[:'expunge'] if !opts[:'expunge'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_delete", :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: EventTypeApi#v1_event_type_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Event Type Export From Openapi # Exports event type definitions based on the OpenAPI schemas associated with each existing event type # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [ExportEventTypeOut] def v1_event_type_export_openapi(opts = {}) data, _status_code, _headers = v1_event_type_export_openapi_with_http_info(opts) data end # Event Type Export From Openapi # Exports event type definitions based on the OpenAPI schemas associated with each existing event type # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ExportEventTypeOut, Integer, Hash)>] ExportEventTypeOut data, response status code and response headers def v1_event_type_export_openapi_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_export_openapi ...' end # resource path local_var_path = '/api/v1/event-type/export/openapi/' # 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']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ExportEventTypeOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_export_openapi", :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: EventTypeApi#v1_event_type_export_openapi\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Generate Schema Example # Generates a fake example from the given JSONSchema # @param event_type_schema_in [EventTypeSchemaIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EventTypeExampleOut] def v1_event_type_generate_example(event_type_schema_in, opts = {}) data, _status_code, _headers = v1_event_type_generate_example_with_http_info(event_type_schema_in, opts) data end # Generate Schema Example # Generates a fake example from the given JSONSchema # @param event_type_schema_in [EventTypeSchemaIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EventTypeExampleOut, Integer, Hash)>] EventTypeExampleOut data, response status code and response headers def v1_event_type_generate_example_with_http_info(event_type_schema_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_generate_example ...' end # verify the required parameter 'event_type_schema_in' is set if @api_client.config.client_side_validation && event_type_schema_in.nil? fail ArgumentError, "Missing the required parameter 'event_type_schema_in' when calling EventTypeApi.v1_event_type_generate_example" end # resource path local_var_path = '/api/v1/event-type/schema/generate-example/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_schema_in) # return_type return_type = opts[:debug_return_type] || 'EventTypeExampleOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_generate_example", :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: EventTypeApi#v1_event_type_generate_example\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Event Type # Get an event type. # @param event_type_name [String] The event type's name # @param [Hash] opts the optional parameters # @return [EventTypeOut] def v1_event_type_get(event_type_name, opts = {}) data, _status_code, _headers = v1_event_type_get_with_http_info(event_type_name, opts) data end # Get Event Type # Get an event type. # @param event_type_name [String] The event type's name # @param [Hash] opts the optional parameters # @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers def v1_event_type_get_with_http_info(event_type_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_get ...' end # verify the required parameter 'event_type_name' is set if @api_client.config.client_side_validation && event_type_name.nil? fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.v1_event_type_get" end if @api_client.config.client_side_validation && event_type_name.to_s.length > 256 fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.v1_event_type_get, the character length must be smaller than or equal to 256.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && event_type_name !~ pattern fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.v1_event_type_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EventTypeOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_get", :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: EventTypeApi#v1_event_type_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Retry Schedule # Gets the retry schedule for messages using the given event type # @param event_type_name [String] The event type's name # @param [Hash] opts the optional parameters # @return [RetryScheduleInOut] def v1_event_type_get_retry_schedule(event_type_name, opts = {}) data, _status_code, _headers = v1_event_type_get_retry_schedule_with_http_info(event_type_name, opts) data end # Get Retry Schedule # Gets the retry schedule for messages using the given event type # @param event_type_name [String] The event type's name # @param [Hash] opts the optional parameters # @return [Array<(RetryScheduleInOut, Integer, Hash)>] RetryScheduleInOut data, response status code and response headers def v1_event_type_get_retry_schedule_with_http_info(event_type_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_get_retry_schedule ...' end # verify the required parameter 'event_type_name' is set if @api_client.config.client_side_validation && event_type_name.nil? fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.v1_event_type_get_retry_schedule" end if @api_client.config.client_side_validation && event_type_name.to_s.length > 256 fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.v1_event_type_get_retry_schedule, the character length must be smaller than or equal to 256.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && event_type_name !~ pattern fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.v1_event_type_get_retry_schedule, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/event-type/{event_type_name}/retry-schedule/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'RetryScheduleInOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_get_retry_schedule", :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: EventTypeApi#v1_event_type_get_retry_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Event Type Import From Openapi # Given an OpenAPI spec, create new or update existing event types. If an existing `archived` event type is updated, it will be unarchvied. The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks` top-level. # @param event_type_import_open_api_in [EventTypeImportOpenApiIn] Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EventTypeImportOpenApiOut] def v1_event_type_import_openapi(event_type_import_open_api_in, opts = {}) data, _status_code, _headers = v1_event_type_import_openapi_with_http_info(event_type_import_open_api_in, opts) data end # Event Type Import From Openapi # Given an OpenAPI spec, create new or update existing event types. If an existing `archived` event type is updated, it will be unarchvied. The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks` top-level. # @param event_type_import_open_api_in [EventTypeImportOpenApiIn] Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EventTypeImportOpenApiOut, Integer, Hash)>] EventTypeImportOpenApiOut data, response status code and response headers def v1_event_type_import_openapi_with_http_info(event_type_import_open_api_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_import_openapi ...' end # verify the required parameter 'event_type_import_open_api_in' is set if @api_client.config.client_side_validation && event_type_import_open_api_in.nil? fail ArgumentError, "Missing the required parameter 'event_type_import_open_api_in' when calling EventTypeApi.v1_event_type_import_openapi" end # resource path local_var_path = '/api/v1/event-type/import/openapi/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_import_open_api_in) # return_type return_type = opts[:debug_return_type] || 'EventTypeImportOpenApiOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_import_openapi", :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: EventTypeApi#v1_event_type_import_openapi\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Event Types # Return the list of event types. # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Limit the number of returned items # @option opts [String] :iterator The iterator returned from a prior invocation # @option opts [Ordering] :order The sorting order of the returned items # @option opts [Boolean] :include_archived When `true` archived (deleted but not expunged) items are included in the response (default to false) # @option opts [Boolean] :with_content When `true` the full item (including the schema) is included in the response (default to false) # @return [ListResponseEventTypeOut] def v1_event_type_list(opts = {}) data, _status_code, _headers = v1_event_type_list_with_http_info(opts) data end # List Event Types # Return the list of event types. # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Limit the number of returned items # @option opts [String] :iterator The iterator returned from a prior invocation # @option opts [Ordering] :order The sorting order of the returned items # @option opts [Boolean] :include_archived When `true` archived (deleted but not expunged) items are included in the response # @option opts [Boolean] :with_content When `true` the full item (including the schema) is included in the response # @return [Array<(ListResponseEventTypeOut, Integer, Hash)>] ListResponseEventTypeOut data, response status code and response headers def v1_event_type_list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_list ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EventTypeApi.v1_event_type_list, must be smaller than or equal to 250.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EventTypeApi.v1_event_type_list, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'].to_s.length > 256 fail ArgumentError, 'invalid value for "opts[:"iterator"]" when calling EventTypeApi.v1_event_type_list, the character length must be smaller than or equal to 256.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"iterator\"]' when calling EventTypeApi.v1_event_type_list, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/event-type/' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? query_params[:'include_archived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil? query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseEventTypeOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_list", :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: EventTypeApi#v1_event_type_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Patch Event Type # Partially update an event type. # @param event_type_name [String] The event type's name # @param event_type_patch [EventTypePatch] # @param [Hash] opts the optional parameters # @return [EventTypeOut] def v1_event_type_patch(event_type_name, event_type_patch, opts = {}) data, _status_code, _headers = v1_event_type_patch_with_http_info(event_type_name, event_type_patch, opts) data end # Patch Event Type # Partially update an event type. # @param event_type_name [String] The event type's name # @param event_type_patch [EventTypePatch] # @param [Hash] opts the optional parameters # @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers def v1_event_type_patch_with_http_info(event_type_name, event_type_patch, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_patch ...' end # verify the required parameter 'event_type_name' is set if @api_client.config.client_side_validation && event_type_name.nil? fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.v1_event_type_patch" end if @api_client.config.client_side_validation && event_type_name.to_s.length > 256 fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.v1_event_type_patch, the character length must be smaller than or equal to 256.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && event_type_name !~ pattern fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.v1_event_type_patch, must conform to the pattern #{pattern}." end # verify the required parameter 'event_type_patch' is set if @api_client.config.client_side_validation && event_type_patch.nil? fail ArgumentError, "Missing the required parameter 'event_type_patch' when calling EventTypeApi.v1_event_type_patch" end # resource path local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_patch) # return_type return_type = opts[:debug_return_type] || 'EventTypeOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_patch", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EventTypeApi#v1_event_type_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Event Type # Update an event type. # @param event_type_name [String] The event type's name # @param event_type_update [EventTypeUpdate] # @param [Hash] opts the optional parameters # @return [EventTypeOut] def v1_event_type_update(event_type_name, event_type_update, opts = {}) data, _status_code, _headers = v1_event_type_update_with_http_info(event_type_name, event_type_update, opts) data end # Update Event Type # Update an event type. # @param event_type_name [String] The event type's name # @param event_type_update [EventTypeUpdate] # @param [Hash] opts the optional parameters # @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers def v1_event_type_update_with_http_info(event_type_name, event_type_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_update ...' end # verify the required parameter 'event_type_name' is set if @api_client.config.client_side_validation && event_type_name.nil? fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.v1_event_type_update" end if @api_client.config.client_side_validation && event_type_name.to_s.length > 256 fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.v1_event_type_update, the character length must be smaller than or equal to 256.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && event_type_name !~ pattern fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.v1_event_type_update, must conform to the pattern #{pattern}." end # verify the required parameter 'event_type_update' is set if @api_client.config.client_side_validation && event_type_update.nil? fail ArgumentError, "Missing the required parameter 'event_type_update' when calling EventTypeApi.v1_event_type_update" end # resource path local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_update) # return_type return_type = opts[:debug_return_type] || 'EventTypeOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_update", :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: EventTypeApi#v1_event_type_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Retry Schedule # Sets a retry schedule for all messages using the given event type # @param event_type_name [String] The event type's name # @param retry_schedule_in_out [RetryScheduleInOut] # @param [Hash] opts the optional parameters # @return [RetryScheduleInOut] def v1_event_type_update_retry_schedule(event_type_name, retry_schedule_in_out, opts = {}) data, _status_code, _headers = v1_event_type_update_retry_schedule_with_http_info(event_type_name, retry_schedule_in_out, opts) data end # Update Retry Schedule # Sets a retry schedule for all messages using the given event type # @param event_type_name [String] The event type's name # @param retry_schedule_in_out [RetryScheduleInOut] # @param [Hash] opts the optional parameters # @return [Array<(RetryScheduleInOut, Integer, Hash)>] RetryScheduleInOut data, response status code and response headers def v1_event_type_update_retry_schedule_with_http_info(event_type_name, retry_schedule_in_out, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_update_retry_schedule ...' end # verify the required parameter 'event_type_name' is set if @api_client.config.client_side_validation && event_type_name.nil? fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.v1_event_type_update_retry_schedule" end if @api_client.config.client_side_validation && event_type_name.to_s.length > 256 fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.v1_event_type_update_retry_schedule, the character length must be smaller than or equal to 256.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && event_type_name !~ pattern fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.v1_event_type_update_retry_schedule, must conform to the pattern #{pattern}." end # verify the required parameter 'retry_schedule_in_out' is set if @api_client.config.client_side_validation && retry_schedule_in_out.nil? fail ArgumentError, "Missing the required parameter 'retry_schedule_in_out' when calling EventTypeApi.v1_event_type_update_retry_schedule" end # resource path local_var_path = '/api/v1/event-type/{event_type_name}/retry-schedule/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(retry_schedule_in_out) # return_type return_type = opts[:debug_return_type] || 'RetryScheduleInOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EventTypeApi.v1_event_type_update_retry_schedule", :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: EventTypeApi#v1_event_type_update_retry_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end