=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 Generator version: 7.9.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] The app's ID or UID # @param endpoint_in [EndpointIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EndpointOut] def v1_endpoint_create(app_id, endpoint_in, opts = {}) data, _status_code, _headers = v1_endpoint_create_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] The app's ID or UID # @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 v1_endpoint_create_with_http_info(app_id, endpoint_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_create ...' 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.v1_endpoint_create" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_create, 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.v1_endpoint_create, 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.v1_endpoint_create, 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.v1_endpoint_create" 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end 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.v1_endpoint_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: EndpointApi#v1_endpoint_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Endpoint # Delete an endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [nil] def v1_endpoint_delete(app_id, endpoint_id, opts = {}) v1_endpoint_delete_with_http_info(app_id, endpoint_id, opts) nil end # Delete Endpoint # Delete an endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_endpoint_delete_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_delete ...' 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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_delete, 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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_delete, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}'.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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_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#v1_endpoint_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Endpoint Mtls Config # Delete endpoint mTLS configuration. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [nil] def v1_endpoint_delete_mtls_config(app_id, endpoint_id, opts = {}) v1_endpoint_delete_mtls_config_with_http_info(app_id, endpoint_id, opts) nil end # Delete Endpoint Mtls Config # Delete endpoint mTLS configuration. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_endpoint_delete_mtls_config_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_delete_mtls_config ...' 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.v1_endpoint_delete_mtls_config" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_delete_mtls_config, 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.v1_endpoint_delete_mtls_config, 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.v1_endpoint_delete_mtls_config, 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.v1_endpoint_delete_mtls_config" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_delete_mtls_config, 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.v1_endpoint_delete_mtls_config, 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.v1_endpoint_delete_mtls_config, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls'.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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_delete_mtls_config", :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#v1_endpoint_delete_mtls_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Endpoint Oauth Config # Delete endpoint OAuth configuration. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [nil] def v1_endpoint_delete_oauth_config(app_id, endpoint_id, opts = {}) v1_endpoint_delete_oauth_config_with_http_info(app_id, endpoint_id, opts) nil end # Delete Endpoint Oauth Config # Delete endpoint OAuth configuration. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_endpoint_delete_oauth_config_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_delete_oauth_config ...' 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.v1_endpoint_delete_oauth_config" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_delete_oauth_config, 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.v1_endpoint_delete_oauth_config, 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.v1_endpoint_delete_oauth_config, 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.v1_endpoint_delete_oauth_config" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_delete_oauth_config, 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.v1_endpoint_delete_oauth_config, 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.v1_endpoint_delete_oauth_config, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth'.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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_delete_oauth_config", :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#v1_endpoint_delete_oauth_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Endpoint # Get an endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [EndpointOut] def v1_endpoint_get(app_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_endpoint_get_with_http_info(app_id, endpoint_id, opts) data end # Get Endpoint # Get an endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers def v1_endpoint_get_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_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.v1_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.v1_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.v1_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.v1_endpoint_get, 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.v1_endpoint_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.v1_endpoint_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.v1_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 && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.v1_endpoint_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}'.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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_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#v1_endpoint_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 app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [EndpointHeadersOut] def v1_endpoint_get_headers(app_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_endpoint_get_headers_with_http_info(app_id, endpoint_id, opts) data end # Get Endpoint Headers # Get the additional headers to be sent with the webhook. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [Array<(EndpointHeadersOut, Integer, Hash)>] EndpointHeadersOut data, response status code and response headers def v1_endpoint_get_headers_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_get_headers ...' 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.v1_endpoint_get_headers" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_get_headers, 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.v1_endpoint_get_headers, 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.v1_endpoint_get_headers, 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.v1_endpoint_get_headers" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_get_headers, 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.v1_endpoint_get_headers, 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.v1_endpoint_get_headers, must conform to the pattern #{pattern}." 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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EndpointHeadersOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_get_headers", :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#v1_endpoint_get_headers\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 app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [EndpointSecretOut] def v1_endpoint_get_secret(app_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_endpoint_get_secret_with_http_info(app_id, endpoint_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 app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [Array<(EndpointSecretOut, Integer, Hash)>] EndpointSecretOut data, response status code and response headers def v1_endpoint_get_secret_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_get_secret ...' 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.v1_endpoint_get_secret" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_get_secret, 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.v1_endpoint_get_secret, 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.v1_endpoint_get_secret, 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.v1_endpoint_get_secret" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_get_secret, 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.v1_endpoint_get_secret, 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.v1_endpoint_get_secret, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret'.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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EndpointSecretOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_get_secret", :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#v1_endpoint_get_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Endpoint Stats # Get basic statistics for the endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @option opts [Time] :since Filter the range to data starting from this date. # @option opts [Time] :_until Filter the range to data ending by this date. # @return [EndpointStats] def v1_endpoint_get_stats(app_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_endpoint_get_stats_with_http_info(app_id, endpoint_id, opts) data end # Endpoint Stats # Get basic statistics for the endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @option opts [Time] :since Filter the range to data starting from this date. # @option opts [Time] :_until Filter the range to data ending by this date. # @return [Array<(EndpointStats, Integer, Hash)>] EndpointStats data, response status code and response headers def v1_endpoint_get_stats_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_get_stats ...' 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.v1_endpoint_get_stats" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_get_stats, 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.v1_endpoint_get_stats, 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.v1_endpoint_get_stats, 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.v1_endpoint_get_stats" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_get_stats, 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.v1_endpoint_get_stats, 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.v1_endpoint_get_stats, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats'.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] || {} query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EndpointStats' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_get_stats", :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#v1_endpoint_get_stats\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] The app's ID or UID # @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 # @return [ListResponseEndpointOut] def v1_endpoint_list(app_id, opts = {}) data, _status_code, _headers = v1_endpoint_list_with_http_info(app_id, opts) data end # List Endpoints # List the application's endpoints. # @param app_id [String] The app's ID or UID # @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 # @return [Array<(ListResponseEndpointOut, Integer, Hash)>] ListResponseEndpointOut data, response status code and response headers def v1_endpoint_list_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_list ...' 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.v1_endpoint_list" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_list, 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.v1_endpoint_list, 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.v1_endpoint_list, 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.v1_endpoint_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 EndpointApi.v1_endpoint_list, must be greater than or equal to 1.' 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[:'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? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseEndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_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: EndpointApi#v1_endpoint_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Patch Endpoint # Partially update an endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_patch [EndpointPatch] # @param [Hash] opts the optional parameters # @return [EndpointOut] def v1_endpoint_patch(app_id, endpoint_id, endpoint_patch, opts = {}) data, _status_code, _headers = v1_endpoint_patch_with_http_info(app_id, endpoint_id, endpoint_patch, opts) data end # Patch Endpoint # Partially update an endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_patch [EndpointPatch] # @param [Hash] opts the optional parameters # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers def v1_endpoint_patch_with_http_info(app_id, endpoint_id, endpoint_patch, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_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.v1_endpoint_patch, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_patch' is set if @api_client.config.client_side_validation && endpoint_patch.nil? fail ArgumentError, "Missing the required parameter 'endpoint_patch' when calling EndpointApi.v1_endpoint_patch" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_patch) # return_type return_type = opts[:debug_return_type] || 'EndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_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#v1_endpoint_patch\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] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_headers_patch_in [EndpointHeadersPatchIn] # @param [Hash] opts the optional parameters # @return [nil] def v1_endpoint_patch_headers(app_id, endpoint_id, endpoint_headers_patch_in, opts = {}) v1_endpoint_patch_headers_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] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_headers_patch_in [EndpointHeadersPatchIn] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_endpoint_patch_headers_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.v1_endpoint_patch_headers ...' 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.v1_endpoint_patch_headers" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_patch_headers, 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.v1_endpoint_patch_headers, 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.v1_endpoint_patch_headers, 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.v1_endpoint_patch_headers" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_patch_headers, 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.v1_endpoint_patch_headers, 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.v1_endpoint_patch_headers, 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.v1_endpoint_patch_headers" 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(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.v1_endpoint_patch_headers", :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#v1_endpoint_patch_headers\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. Messages that were sent successfully, even if failed initially, are not resent. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param recover_in [RecoverIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [RecoverOut] def v1_endpoint_recover(app_id, endpoint_id, recover_in, opts = {}) data, _status_code, _headers = v1_endpoint_recover_with_http_info(app_id, endpoint_id, recover_in, opts) data end # Recover Failed Webhooks # Resend all failed messages since a given time. Messages that were sent successfully, even if failed initially, are not resent. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param recover_in [RecoverIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(RecoverOut, Integer, Hash)>] RecoverOut data, response status code and response headers def v1_endpoint_recover_with_http_info(app_id, endpoint_id, recover_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_recover ...' 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.v1_endpoint_recover" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_recover, 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.v1_endpoint_recover, 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.v1_endpoint_recover, 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.v1_endpoint_recover" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_recover, 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.v1_endpoint_recover, 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.v1_endpoint_recover, 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.v1_endpoint_recover" 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end 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] || 'RecoverOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_recover", :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#v1_endpoint_recover\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Replay Missing Webhooks # Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param replay_in [ReplayIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [ReplayOut] def v1_endpoint_replay_missing(app_id, endpoint_id, replay_in, opts = {}) data, _status_code, _headers = v1_endpoint_replay_missing_with_http_info(app_id, endpoint_id, replay_in, opts) data end # Replay Missing Webhooks # Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param replay_in [ReplayIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ReplayOut, Integer, Hash)>] ReplayOut data, response status code and response headers def v1_endpoint_replay_missing_with_http_info(app_id, endpoint_id, replay_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_replay_missing ...' 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.v1_endpoint_replay_missing" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_replay_missing, 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.v1_endpoint_replay_missing, 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.v1_endpoint_replay_missing, 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.v1_endpoint_replay_missing" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_replay_missing, 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.v1_endpoint_replay_missing, 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.v1_endpoint_replay_missing, must conform to the pattern #{pattern}." end # verify the required parameter 'replay_in' is set if @api_client.config.client_side_validation && replay_in.nil? fail ArgumentError, "Missing the required parameter 'replay_in' when calling EndpointApi.v1_endpoint_replay_missing" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end 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(replay_in) # return_type return_type = opts[:debug_return_type] || 'ReplayOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_replay_missing", :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#v1_endpoint_replay_missing\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 remain valid for the next 24 hours. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @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 v1_endpoint_rotate_secret(app_id, endpoint_id, endpoint_secret_rotate_in, opts = {}) v1_endpoint_rotate_secret_with_http_info(app_id, endpoint_id, endpoint_secret_rotate_in, opts) nil end # Rotate Endpoint Secret # Rotates the endpoint's signing secret. The previous secret will remain valid for the next 24 hours. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @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 v1_endpoint_rotate_secret_with_http_info(app_id, endpoint_id, endpoint_secret_rotate_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_rotate_secret ...' 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.v1_endpoint_rotate_secret" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_rotate_secret, 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.v1_endpoint_rotate_secret, 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.v1_endpoint_rotate_secret, 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.v1_endpoint_rotate_secret" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_rotate_secret, 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.v1_endpoint_rotate_secret, 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.v1_endpoint_rotate_secret, 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.v1_endpoint_rotate_secret" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end 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.v1_endpoint_rotate_secret", :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#v1_endpoint_rotate_secret\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 an event. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param event_example_in [EventExampleIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [MessageOut] def v1_endpoint_send_example(app_id, endpoint_id, event_example_in, opts = {}) data, _status_code, _headers = v1_endpoint_send_example_with_http_info(app_id, endpoint_id, event_example_in, opts) data end # Send Event Type Example Message # Send an example message for an event. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @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 v1_endpoint_send_example_with_http_info(app_id, endpoint_id, event_example_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_send_example ...' 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.v1_endpoint_send_example" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_send_example, 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.v1_endpoint_send_example, 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.v1_endpoint_send_example, 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.v1_endpoint_send_example" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_send_example, 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.v1_endpoint_send_example, 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.v1_endpoint_send_example, 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.v1_endpoint_send_example" 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end 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.v1_endpoint_send_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: EndpointApi#v1_endpoint_send_example\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Endpoint Transformation # Get the transformation code associated with this endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [EndpointTransformationOut] def v1_endpoint_transformation_get(app_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_endpoint_transformation_get_with_http_info(app_id, endpoint_id, opts) data end # Get Endpoint Transformation # Get the transformation code associated with this endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [Array<(EndpointTransformationOut, Integer, Hash)>] EndpointTransformationOut data, response status code and response headers def v1_endpoint_transformation_get_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_transformation_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.v1_endpoint_transformation_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.v1_endpoint_transformation_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.v1_endpoint_transformation_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.v1_endpoint_transformation_get, 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.v1_endpoint_transformation_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.v1_endpoint_transformation_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.v1_endpoint_transformation_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.v1_endpoint_transformation_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation'.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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EndpointTransformationOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_transformation_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#v1_endpoint_transformation_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Set Endpoint Transformation # Set or unset the transformation code associated with this endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_transformation_in [EndpointTransformationIn] # @param [Hash] opts the optional parameters # @return [nil] def v1_endpoint_transformation_partial_update(app_id, endpoint_id, endpoint_transformation_in, opts = {}) v1_endpoint_transformation_partial_update_with_http_info(app_id, endpoint_id, endpoint_transformation_in, opts) nil end # Set Endpoint Transformation # Set or unset the transformation code associated with this endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_transformation_in [EndpointTransformationIn] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_endpoint_transformation_partial_update_with_http_info(app_id, endpoint_id, endpoint_transformation_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_transformation_partial_update ...' 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.v1_endpoint_transformation_partial_update" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_transformation_partial_update, 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.v1_endpoint_transformation_partial_update, 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.v1_endpoint_transformation_partial_update, 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.v1_endpoint_transformation_partial_update" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_transformation_partial_update, 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.v1_endpoint_transformation_partial_update, 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.v1_endpoint_transformation_partial_update, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_transformation_in' is set if @api_client.config.client_side_validation && endpoint_transformation_in.nil? fail ArgumentError, "Missing the required parameter 'endpoint_transformation_in' when calling EndpointApi.v1_endpoint_transformation_partial_update" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_transformation_in) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_transformation_partial_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(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EndpointApi#v1_endpoint_transformation_partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Simulate # Simulate running the transformation on the payload and code. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_transformation_simulate_in [EndpointTransformationSimulateIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [EndpointTransformationSimulateOut] def v1_endpoint_transformation_simulate(app_id, endpoint_id, endpoint_transformation_simulate_in, opts = {}) data, _status_code, _headers = v1_endpoint_transformation_simulate_with_http_info(app_id, endpoint_id, endpoint_transformation_simulate_in, opts) data end # Simulate # Simulate running the transformation on the payload and code. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_transformation_simulate_in [EndpointTransformationSimulateIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(EndpointTransformationSimulateOut, Integer, Hash)>] EndpointTransformationSimulateOut data, response status code and response headers def v1_endpoint_transformation_simulate_with_http_info(app_id, endpoint_id, endpoint_transformation_simulate_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_transformation_simulate ...' 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.v1_endpoint_transformation_simulate" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_transformation_simulate, 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.v1_endpoint_transformation_simulate, 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.v1_endpoint_transformation_simulate, 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.v1_endpoint_transformation_simulate" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_transformation_simulate, 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.v1_endpoint_transformation_simulate, 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.v1_endpoint_transformation_simulate, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_transformation_simulate_in' is set if @api_client.config.client_side_validation && endpoint_transformation_simulate_in.nil? fail ArgumentError, "Missing the required parameter 'endpoint_transformation_simulate_in' when calling EndpointApi.v1_endpoint_transformation_simulate" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end 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_transformation_simulate_in) # return_type return_type = opts[:debug_return_type] || 'EndpointTransformationSimulateOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_transformation_simulate", :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#v1_endpoint_transformation_simulate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Endpoint # Update an endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_update [EndpointUpdate] # @param [Hash] opts the optional parameters # @return [EndpointOut] def v1_endpoint_update(app_id, endpoint_id, endpoint_update, opts = {}) data, _status_code, _headers = v1_endpoint_update_with_http_info(app_id, endpoint_id, endpoint_update, opts) data end # Update Endpoint # Update an endpoint. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_update [EndpointUpdate] # @param [Hash] opts the optional parameters # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers def v1_endpoint_update_with_http_info(app_id, endpoint_id, endpoint_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_update ...' 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.v1_endpoint_update" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_update, 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.v1_endpoint_update, 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.v1_endpoint_update, 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.v1_endpoint_update" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_update, 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.v1_endpoint_update, 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.v1_endpoint_update, 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.v1_endpoint_update" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(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.v1_endpoint_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: EndpointApi#v1_endpoint_update\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] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_headers_in [EndpointHeadersIn] # @param [Hash] opts the optional parameters # @return [nil] def v1_endpoint_update_headers(app_id, endpoint_id, endpoint_headers_in, opts = {}) v1_endpoint_update_headers_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] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_headers_in [EndpointHeadersIn] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_endpoint_update_headers_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_update_headers ...' 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.v1_endpoint_update_headers" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_update_headers, 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.v1_endpoint_update_headers, 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.v1_endpoint_update_headers, 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.v1_endpoint_update_headers" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_update_headers, 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.v1_endpoint_update_headers, 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.v1_endpoint_update_headers, 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.v1_endpoint_update_headers" 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(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.v1_endpoint_update_headers", :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#v1_endpoint_update_headers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Endpoint Mtls Config # Create/update endpoint mTLS configuration. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_mtls_config_in [EndpointMtlsConfigIn] # @param [Hash] opts the optional parameters # @return [nil] def v1_endpoint_update_mtls_config(app_id, endpoint_id, endpoint_mtls_config_in, opts = {}) v1_endpoint_update_mtls_config_with_http_info(app_id, endpoint_id, endpoint_mtls_config_in, opts) nil end # Update Endpoint Mtls Config # Create/update endpoint mTLS configuration. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_mtls_config_in [EndpointMtlsConfigIn] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_endpoint_update_mtls_config_with_http_info(app_id, endpoint_id, endpoint_mtls_config_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_update_mtls_config ...' 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.v1_endpoint_update_mtls_config" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_update_mtls_config, 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.v1_endpoint_update_mtls_config, 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.v1_endpoint_update_mtls_config, 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.v1_endpoint_update_mtls_config" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_update_mtls_config, 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.v1_endpoint_update_mtls_config, 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.v1_endpoint_update_mtls_config, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_mtls_config_in' is set if @api_client.config.client_side_validation && endpoint_mtls_config_in.nil? fail ArgumentError, "Missing the required parameter 'endpoint_mtls_config_in' when calling EndpointApi.v1_endpoint_update_mtls_config" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_mtls_config_in) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_update_mtls_config", :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#v1_endpoint_update_mtls_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Endpoint Oauth Config # Create/update endpoint OAuth configuration. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_oauth_config_in [EndpointOauthConfigIn] # @param [Hash] opts the optional parameters # @return [nil] def v1_endpoint_update_oauth_config(app_id, endpoint_id, endpoint_oauth_config_in, opts = {}) v1_endpoint_update_oauth_config_with_http_info(app_id, endpoint_id, endpoint_oauth_config_in, opts) nil end # Update Endpoint Oauth Config # Create/update endpoint OAuth configuration. # @param app_id [String] The app's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param endpoint_oauth_config_in [EndpointOauthConfigIn] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_endpoint_update_oauth_config_with_http_info(app_id, endpoint_id, endpoint_oauth_config_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_endpoint_update_oauth_config ...' 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.v1_endpoint_update_oauth_config" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_endpoint_update_oauth_config, 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.v1_endpoint_update_oauth_config, 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.v1_endpoint_update_oauth_config, 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.v1_endpoint_update_oauth_config" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.v1_endpoint_update_oauth_config, 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.v1_endpoint_update_oauth_config, 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.v1_endpoint_update_oauth_config, must conform to the pattern #{pattern}." end # verify the required parameter 'endpoint_oauth_config_in' is set if @api_client.config.client_side_validation && endpoint_oauth_config_in.nil? fail ArgumentError, "Missing the required parameter 'endpoint_oauth_config_in' when calling EndpointApi.v1_endpoint_update_oauth_config" end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_oauth_config_in) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_endpoint_update_oauth_config", :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#v1_endpoint_update_oauth_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Sink # Create a new sink for the application. # @param app_id [String] The app's ID or UID # @param sink_in [SinkIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [SinkOut] def v1_sink_create(app_id, sink_in, opts = {}) data, _status_code, _headers = v1_sink_create_with_http_info(app_id, sink_in, opts) data end # Create Sink # Create a new sink for the application. # @param app_id [String] The app's ID or UID # @param sink_in [SinkIn] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(SinkOut, Integer, Hash)>] SinkOut data, response status code and response headers def v1_sink_create_with_http_info(app_id, sink_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_sink_create ...' 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.v1_sink_create" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_sink_create, 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.v1_sink_create, 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.v1_sink_create, must conform to the pattern #{pattern}." end # verify the required parameter 'sink_in' is set if @api_client.config.client_side_validation && sink_in.nil? fail ArgumentError, "Missing the required parameter 'sink_in' when calling EndpointApi.v1_sink_create" end # resource path local_var_path = '/api/v1/app/{app_id}/sink'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end 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(sink_in) # return_type return_type = opts[:debug_return_type] || 'SinkOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_sink_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: EndpointApi#v1_sink_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Sink # Get a sink. # @param app_id [String] The app's ID or UID # @param sink_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [SinkOut] def v1_sink_get(app_id, sink_id, opts = {}) data, _status_code, _headers = v1_sink_get_with_http_info(app_id, sink_id, opts) data end # Get Sink # Get a sink. # @param app_id [String] The app's ID or UID # @param sink_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @return [Array<(SinkOut, Integer, Hash)>] SinkOut data, response status code and response headers def v1_sink_get_with_http_info(app_id, sink_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_sink_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.v1_sink_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.v1_sink_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.v1_sink_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.v1_sink_get, must conform to the pattern #{pattern}." end # verify the required parameter 'sink_id' is set if @api_client.config.client_side_validation && sink_id.nil? fail ArgumentError, "Missing the required parameter 'sink_id' when calling EndpointApi.v1_sink_get" end if @api_client.config.client_side_validation && sink_id.to_s.length > 256 fail ArgumentError, 'invalid value for "sink_id" when calling EndpointApi.v1_sink_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && sink_id.to_s.length < 1 fail ArgumentError, 'invalid value for "sink_id" when calling EndpointApi.v1_sink_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 && sink_id !~ pattern fail ArgumentError, "invalid value for 'sink_id' when calling EndpointApi.v1_sink_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/sink/{sink_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'sink_id' + '}', CGI.escape(sink_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SinkOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_sink_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#v1_sink_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Sinks # List the application's sinks. # @param app_id [String] The app's ID or UID # @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 # @return [ListResponseSinkOut] def v1_sink_list(app_id, opts = {}) data, _status_code, _headers = v1_sink_list_with_http_info(app_id, opts) data end # List Sinks # List the application's sinks. # @param app_id [String] The app's ID or UID # @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 # @return [Array<(ListResponseSinkOut, Integer, Hash)>] ListResponseSinkOut data, response status code and response headers def v1_sink_list_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EndpointApi.v1_sink_list ...' 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.v1_sink_list" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_sink_list, 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.v1_sink_list, 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.v1_sink_list, 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.v1_sink_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 EndpointApi.v1_sink_list, must be greater than or equal to 1.' end # resource path local_var_path = '/api/v1/app/{app_id}/sink'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # 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? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseSinkOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"EndpointApi.v1_sink_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: EndpointApi#v1_sink_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end