=begin #Svix API #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. The version of the OpenAPI document: 1.4 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.2.0 =end require 'cgi' module Svix class EndpointApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create Endpoint # Create a new endpoint for the application. When `secret` is `null` the secret is automatically generated (recommended) # @param app_id [String] # @param endpoint_in [EndpointIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EndpointOut] def create_endpoint_api_v1_app_app_id_endpoint_post(app_id, endpoint_in, opts = {}) data, _status_code, _headers = create_endpoint_api_v1_app_app_id_endpoint_post_with_http_info(app_id, endpoint_in, opts) data end # Create Endpoint # Create a new endpoint for the application. When `secret` is `null` the secret is automatically generated (recommended) # @param app_id [String] # @param endpoint_in [EndpointIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers def create_endpoint_api_v1_app_app_id_endpoint_post_with_http_info(app_id, endpoint_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_in' is set if @api_client.config.client_side_validation && endpoint_in.nil? fail ArgumentError, "Missing the required parameter 'endpoint_in' when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 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(endpoint_in) # return_type return_type = opts[:debug_return_type] || 'EndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post", :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: EndpointApi#create_endpoint_api_v1_app_app_id_endpoint_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Endpoint # Delete an endpoint. # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [nil] def delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete(endpoint_id, app_id, opts = {}) delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete_with_http_info(endpoint_id, app_id, opts) nil end # Delete Endpoint # Delete an endpoint. # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete_with_http_info(endpoint_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_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']) 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] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_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: EndpointApi#delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Endpoint # Get an application. # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EndpointOut] def get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get(endpoint_id, app_id, opts = {}) data, _status_code, _headers = get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get_with_http_info(endpoint_id, app_id, opts) data end # Get Endpoint # Get an application. # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers def get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get_with_http_info(endpoint_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_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']) 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] || 'EndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_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: EndpointApi#get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Endpoint Headers # Get the additional headers to be sent with the webhook # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EndpointHeadersOut] def get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get(endpoint_id, app_id, opts = {}) data, _status_code, _headers = get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get_with_http_info(endpoint_id, app_id, opts) data end # Get Endpoint Headers # Get the additional headers to be sent with the webhook # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EndpointHeadersOut, Integer, Hash)>] EndpointHeadersOut data, response status code and response headers def get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get_with_http_info(endpoint_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_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']) 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] || 'EndpointHeadersOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_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: EndpointApi#get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Endpoint Secret # Get the endpoint's signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EndpointSecretOut] def get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get(endpoint_id, app_id, opts = {}) data, _status_code, _headers = get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get_with_http_info(endpoint_id, app_id, opts) data end # Get Endpoint Secret # Get the endpoint's signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EndpointSecretOut, Integer, Hash)>] EndpointSecretOut data, response status code and response headers def get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get_with_http_info(endpoint_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_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']) 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] || 'EndpointSecretOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_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: EndpointApi#get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Endpoint Stats # Get basic statistics for the endpoint. # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EndpointStats] def get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get(endpoint_id, app_id, opts = {}) data, _status_code, _headers = get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get_with_http_info(endpoint_id, app_id, opts) data end # Get Endpoint Stats # Get basic statistics for the endpoint. # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EndpointStats, Integer, Hash)>] EndpointStats data, response status code and response headers def get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get_with_http_info(endpoint_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_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']) 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] || 'EndpointStats' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_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: EndpointApi#get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Endpoints # List the application's endpoints. # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit (default to 50) # @option opts [String] :idempotency_key The request's idempotency key # @return [ListResponseEndpointOut] def list_endpoints_api_v1_app_app_id_endpoint_get(app_id, opts = {}) data, _status_code, _headers = list_endpoints_api_v1_app_app_id_endpoint_get_with_http_info(app_id, opts) data end # List Endpoints # List the application's endpoints. # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ListResponseEndpointOut, Integer, Hash)>] ListResponseEndpointOut data, response status code and response headers def list_endpoints_api_v1_app_app_id_endpoint_get_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get, must be smaller than or equal to 250.' end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # 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] || 'ListResponseEndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_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: EndpointApi#list_endpoints_api_v1_app_app_id_endpoint_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Patch Endpoint Headers # Partially set the additional headers to be sent with the webhook # @param app_id [String] # @param endpoint_id [String] # @param endpoint_headers_patch_in [EndpointHeadersPatchIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [nil] def patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch(app_id, endpoint_id, endpoint_headers_patch_in, opts = {}) patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch_with_http_info(app_id, endpoint_id, endpoint_headers_patch_in, opts) nil end # Patch Endpoint Headers # Partially set the additional headers to be sent with the webhook # @param app_id [String] # @param endpoint_id [String] # @param endpoint_headers_patch_in [EndpointHeadersPatchIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch_with_http_info(app_id, endpoint_id, endpoint_headers_patch_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_headers_patch_in' is set if @api_client.config.client_side_validation && endpoint_headers_patch_in.nil? fail ArgumentError, "Missing the required parameter 'endpoint_headers_patch_in' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 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(endpoint_headers_patch_in) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_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: EndpointApi#patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Recover Failed Webhooks # Resend all failed messages since a given time. # @param app_id [String] # @param endpoint_id [String] # @param recover_in [RecoverIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Object] def recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post(app_id, endpoint_id, recover_in, opts = {}) data, _status_code, _headers = recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post_with_http_info(app_id, endpoint_id, recover_in, opts) data end # Recover Failed Webhooks # Resend all failed messages since a given time. # @param app_id [String] # @param endpoint_id [String] # @param recover_in [RecoverIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers def recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post_with_http_info(app_id, endpoint_id, recover_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, must conform to the pattern #{pattern}." end # verify the required parameter 'recover_in' is set if @api_client.config.client_side_validation && recover_in.nil? fail ArgumentError, "Missing the required parameter 'recover_in' when calling EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 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(recover_in) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post", :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: EndpointApi#recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Rotate Endpoint Secret # Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours. # @param endpoint_id [String] # @param app_id [String] # @param endpoint_secret_rotate_in [EndpointSecretRotateIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [nil] def rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post(endpoint_id, app_id, endpoint_secret_rotate_in, opts = {}) rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post_with_http_info(endpoint_id, app_id, endpoint_secret_rotate_in, opts) nil end # Rotate Endpoint Secret # Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours. # @param endpoint_id [String] # @param app_id [String] # @param endpoint_secret_rotate_in [EndpointSecretRotateIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post_with_http_info(endpoint_id, app_id, endpoint_secret_rotate_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_secret_rotate_in' is set if @api_client.config.client_side_validation && endpoint_secret_rotate_in.nil? fail ArgumentError, "Missing the required parameter 'endpoint_secret_rotate_in' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 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(endpoint_secret_rotate_in) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post", :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: EndpointApi#rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send Event Type Example Message # Send an example message for event # @param app_id [String] # @param endpoint_id [String] # @param event_example_in [EventExampleIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [MessageOut] def send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post(app_id, endpoint_id, event_example_in, opts = {}) data, _status_code, _headers = send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post_with_http_info(app_id, endpoint_id, event_example_in, opts) data end # Send Event Type Example Message # Send an example message for event # @param app_id [String] # @param endpoint_id [String] # @param event_example_in [EventExampleIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers def send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post_with_http_info(app_id, endpoint_id, event_example_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, must conform to the pattern #{pattern}." end # verify the required parameter 'event_example_in' is set if @api_client.config.client_side_validation && event_example_in.nil? fail ArgumentError, "Missing the required parameter 'event_example_in' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 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_example_in) # return_type return_type = opts[:debug_return_type] || 'MessageOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post", :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: EndpointApi#send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Endpoint # Update an endpoint. # @param endpoint_id [String] # @param app_id [String] # @param endpoint_update [EndpointUpdate] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EndpointOut] def update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put(endpoint_id, app_id, endpoint_update, opts = {}) data, _status_code, _headers = update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put_with_http_info(endpoint_id, app_id, endpoint_update, opts) data end # Update Endpoint # Update an endpoint. # @param endpoint_id [String] # @param app_id [String] # @param endpoint_update [EndpointUpdate] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers def update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put_with_http_info(endpoint_id, app_id, endpoint_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_update' is set if @api_client.config.client_side_validation && endpoint_update.nil? fail ArgumentError, "Missing the required parameter 'endpoint_update' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 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(endpoint_update) # return_type return_type = opts[:debug_return_type] || 'EndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put", :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: EndpointApi#update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Endpoint Headers # Set the additional headers to be sent with the webhook # @param app_id [String] # @param endpoint_id [String] # @param endpoint_headers_in [EndpointHeadersIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [nil] def update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put(app_id, endpoint_id, endpoint_headers_in, opts = {}) update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts) nil end # Update Endpoint Headers # Set the additional headers to be sent with the webhook # @param app_id [String] # @param endpoint_id [String] # @param endpoint_headers_in [EndpointHeadersIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_headers_in' is set if @api_client.config.client_side_validation && endpoint_headers_in.nil? fail ArgumentError, "Missing the required parameter 'endpoint_headers_in' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 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(endpoint_headers_in) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put", :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: EndpointApi#update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end