=begin #Svix API #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. The version of the OpenAPI document: 1.4 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.2.0 =end require 'cgi' module Svix class MessageAttemptApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get Attempt # `msg_id`: Use a message id or a message `eventId` # @param attempt_id [String] # @param msg_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [MessageAttemptOut] def get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get(attempt_id, msg_id, app_id, opts = {}) data, _status_code, _headers = get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get_with_http_info(attempt_id, msg_id, app_id, opts) data end # Get Attempt # `msg_id`: Use a message id or a message `eventId` # @param attempt_id [String] # @param msg_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(MessageAttemptOut, Integer, Hash)>] MessageAttemptOut data, response status code and response headers def get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get_with_http_info(attempt_id, msg_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get ...' end # verify the required parameter 'attempt_id' is set if @api_client.config.client_side_validation && attempt_id.nil? fail ArgumentError, "Missing the required parameter 'attempt_id' when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get" end # verify the required parameter 'msg_id' is set if @api_client.config.client_side_validation && msg_id.nil? fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && msg_id.to_s.length < 1 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && msg_id !~ pattern fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/'.sub('{' + 'attempt_id' + '}', CGI.escape(attempt_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'MessageAttemptOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessageAttemptApi#get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Attempt Headers # Calculate and return headers used on a given message attempt # @param app_id [String] # @param msg_id [String] # @param attempt_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [MessageAttemptHeadersOut] def get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get(app_id, msg_id, attempt_id, opts = {}) data, _status_code, _headers = get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get_with_http_info(app_id, msg_id, attempt_id, opts) data end # Get Attempt Headers # Calculate and return headers used on a given message attempt # @param app_id [String] # @param msg_id [String] # @param attempt_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(MessageAttemptHeadersOut, Integer, Hash)>] MessageAttemptHeadersOut data, response status code and response headers def get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get_with_http_info(app_id, msg_id, attempt_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_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 MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get, must conform to the pattern #{pattern}." end # verify the required parameter 'msg_id' is set if @api_client.config.client_side_validation && msg_id.nil? fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && msg_id.to_s.length < 1 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && msg_id !~ pattern fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get, must conform to the pattern #{pattern}." end # verify the required parameter 'attempt_id' is set if @api_client.config.client_side_validation && attempt_id.nil? fail ArgumentError, "Missing the required parameter 'attempt_id' when calling MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get" end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/headers/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).sub('{' + 'attempt_id' + '}', CGI.escape(attempt_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'MessageAttemptHeadersOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessageAttemptApi#get_attempt_headers_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_headers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Attempted Destinations # `msg_id`: Use a message id or a message `eventId` # @param msg_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit (default to 50) # @option opts [String] :idempotency_key The request's idempotency key # @return [ListResponseMessageEndpointOut] def list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get(msg_id, app_id, opts = {}) data, _status_code, _headers = list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get_with_http_info(msg_id, app_id, opts) data end # List Attempted Destinations # `msg_id`: Use a message id or a message `eventId` # @param msg_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ListResponseMessageEndpointOut, Integer, Hash)>] ListResponseMessageEndpointOut data, response status code and response headers def list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get_with_http_info(msg_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get ...' end # verify the required parameter 'msg_id' is set if @api_client.config.client_side_validation && msg_id.nil? fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && msg_id.to_s.length < 1 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && msg_id !~ pattern fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get, must be smaller than or equal to 250.' end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/endpoint/'.sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseMessageEndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessageAttemptApi#list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Attempted Messages # List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit (default to 50) # @option opts [String] :channel # @option opts [MessageStatus] :status # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [ListResponseEndpointMessageOut] def list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get(endpoint_id, app_id, opts = {}) data, _status_code, _headers = list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get_with_http_info(endpoint_id, app_id, opts) data end # List Attempted Messages # List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. # @param endpoint_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit # @option opts [String] :channel # @option opts [MessageStatus] :status # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ListResponseEndpointMessageOut, Integer, Hash)>] ListResponseEndpointMessageOut data, response status code and response headers def list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get_with_http_info(endpoint_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_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 MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_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 MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_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 MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_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 MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get, must be smaller than or equal to 250.' end if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get, the character length must be smaller than or equal to 128.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseEndpointMessageOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_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: MessageAttemptApi#list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Attempts # Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead. `msg_id`: Use a message id or a message `eventId` # @param app_id [String] # @param msg_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit (default to 50) # @option opts [String] :endpoint_id # @option opts [Array] :event_types # @option opts [String] :channel # @option opts [MessageStatus] :status # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [ListResponseMessageAttemptOut] def list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get(app_id, msg_id, opts = {}) data, _status_code, _headers = list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get_with_http_info(app_id, msg_id, opts) data end # List Attempts # Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead. `msg_id`: Use a message id or a message `eventId` # @param app_id [String] # @param msg_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit # @option opts [String] :endpoint_id # @option opts [Array] :event_types # @option opts [String] :channel # @option opts [MessageStatus] :status # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers def list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get_with_http_info(app_id, msg_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_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 MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_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 MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_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 MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, must conform to the pattern #{pattern}." end # verify the required parameter 'msg_id' is set if @api_client.config.client_side_validation && msg_id.nil? fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && msg_id.to_s.length < 1 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_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 && msg_id !~ pattern fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, must be smaller than or equal to 250.' end if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'].to_s.length > 256 fail ArgumentError, 'invalid value for "opts[:"endpoint_id"]" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"endpoint_id"]" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_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 && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"endpoint_id\"]' when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, the character length must be smaller than or equal to 128.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'endpoint_id'] = opts[:'endpoint_id'] if !opts[:'endpoint_id'].nil? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil? query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseMessageAttemptOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_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: MessageAttemptApi#list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Attempts By Endpoint # List attempts by endpoint id # @param app_id [String] # @param endpoint_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit (default to 50) # @option opts [MessageStatus] :status # @option opts [StatusCodeClass] :status_code_class # @option opts [Array] :event_types # @option opts [String] :channel # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [ListResponseMessageAttemptOut] def list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get(app_id, endpoint_id, opts = {}) data, _status_code, _headers = list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get_with_http_info(app_id, endpoint_id, opts) data end # List Attempts By Endpoint # List attempts by endpoint id # @param app_id [String] # @param endpoint_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit # @option opts [MessageStatus] :status # @option opts [StatusCodeClass] :status_code_class # @option opts [Array] :event_types # @option opts [String] :channel # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers def list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_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 MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_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 MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, must be smaller than or equal to 250.' end if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be smaller than or equal to 128.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/attempt/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] || {} query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'status_code_class'] = opts[:'status_code_class'] if !opts[:'status_code_class'].nil? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil? query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseMessageAttemptOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessageAttemptApi#list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Attempts By Msg # List attempts by message id # @param app_id [String] # @param msg_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :endpoint_id # @option opts [String] :iterator # @option opts [Integer] :limit (default to 50) # @option opts [MessageStatus] :status # @option opts [StatusCodeClass] :status_code_class # @option opts [Array] :event_types # @option opts [String] :channel # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [ListResponseMessageAttemptOut] def list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get(app_id, msg_id, opts = {}) data, _status_code, _headers = list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get_with_http_info(app_id, msg_id, opts) data end # List Attempts By Msg # List attempts by message id # @param app_id [String] # @param msg_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :endpoint_id # @option opts [String] :iterator # @option opts [Integer] :limit # @option opts [MessageStatus] :status # @option opts [StatusCodeClass] :status_code_class # @option opts [Array] :event_types # @option opts [String] :channel # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers def list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get_with_http_info(app_id, msg_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_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 MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must conform to the pattern #{pattern}." end # verify the required parameter 'msg_id' is set if @api_client.config.client_side_validation && msg_id.nil? fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && msg_id.to_s.length < 1 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && msg_id !~ pattern fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'].to_s.length > 256 fail ArgumentError, 'invalid value for "opts[:"endpoint_id"]" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"endpoint_id"]" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"endpoint_id\"]' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must be smaller than or equal to 250.' end if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be smaller than or equal to 128.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/attempt/msg/{msg_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'endpoint_id'] = opts[:'endpoint_id'] if !opts[:'endpoint_id'].nil? query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'status_code_class'] = opts[:'status_code_class'] if !opts[:'status_code_class'].nil? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil? query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseMessageAttemptOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessageAttemptApi#list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Attempts For Endpoint # DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. List the message attempts for a particular endpoint. Returning the endpoint. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. # @param msg_id [String] # @param app_id [String] # @param endpoint_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit (default to 50) # @option opts [Array] :event_types # @option opts [String] :channel # @option opts [MessageStatus] :status # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [ListResponseMessageAttemptEndpointOut] def list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get(msg_id, app_id, endpoint_id, opts = {}) data, _status_code, _headers = list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get_with_http_info(msg_id, app_id, endpoint_id, opts) data end # List Attempts For Endpoint # DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. List the message attempts for a particular endpoint. Returning the endpoint. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. # @param msg_id [String] # @param app_id [String] # @param endpoint_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :iterator # @option opts [Integer] :limit # @option opts [Array] :event_types # @option opts [String] :channel # @option opts [MessageStatus] :status # @option opts [Time] :before # @option opts [Time] :after # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(ListResponseMessageAttemptEndpointOut, Integer, Hash)>] ListResponseMessageAttemptEndpointOut data, response status code and response headers def list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get_with_http_info(msg_id, app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get ...' end # verify the required parameter 'msg_id' is set if @api_client.config.client_side_validation && msg_id.nil? fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && msg_id.to_s.length < 1 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_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 && msg_id !~ pattern fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_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 MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_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 MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_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 MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_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 MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_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 MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, must be smaller than or equal to 250.' end if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, the character length must be smaller than or equal to 128.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt/'.sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).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[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil? query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListResponseMessageAttemptEndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_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: MessageAttemptApi#list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Resend Webhook # Resend a message to the specified endpoint. # @param endpoint_id [String] # @param msg_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [nil] def resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post(endpoint_id, msg_id, app_id, opts = {}) resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post_with_http_info(endpoint_id, msg_id, app_id, opts) nil end # Resend Webhook # Resend a message to the specified endpoint. # @param endpoint_id [String] # @param msg_id [String] # @param app_id [String] # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post_with_http_info(endpoint_id, msg_id, app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post ...' end # verify the required parameter 'endpoint_id' is set if @api_client.config.client_side_validation && endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && endpoint_id !~ pattern fail ArgumentError, "invalid value for 'endpoint_id' when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, must conform to the pattern #{pattern}." end # verify the required parameter 'msg_id' is set if @api_client.config.client_side_validation && msg_id.nil? fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && msg_id.to_s.length < 1 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && msg_id !~ pattern fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, must conform to the pattern #{pattern}." end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, the character length must be smaller than or equal to 256.' end if @api_client.config.client_side_validation && app_id.to_s.length < 1 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, the character length must be great than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/) if @api_client.config.client_side_validation && app_id !~ pattern fail ArgumentError, "invalid value for 'app_id' when calling MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessageAttemptApi#resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end