=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 MessageAttemptApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Count Attempts By Endpoint # Like `v1.message-attempt.list-by-endpoint` but returning a count only. # @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 [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [StatusCodeClass] :status_code_class Filter response based on the HTTP status code # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Array] :event_types Filter response based on the event type # @return [CountOut] def v1_message_attempt_count_by_endpoint(app_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_message_attempt_count_by_endpoint_with_http_info(app_id, endpoint_id, opts) data end # Count Attempts By Endpoint # Like `v1.message-attempt.list-by-endpoint` but returning a count only. # @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 [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [StatusCodeClass] :status_code_class Filter response based on the HTTP status code # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Array] :event_types Filter response based on the event type # @return [Array<(CountOut, Integer, Hash)>] CountOut data, response status code and response headers def v1_message_attempt_count_by_endpoint_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_count_by_endpoint ...' 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.v1_message_attempt_count_by_endpoint" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_count_by_endpoint, 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.v1_message_attempt_count_by_endpoint, 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.v1_message_attempt_count_by_endpoint, 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.v1_message_attempt_count_by_endpoint" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.v1_message_attempt_count_by_endpoint, 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.v1_message_attempt_count_by_endpoint, 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.v1_message_attempt_count_by_endpoint, 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.v1_message_attempt_count_by_endpoint, 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.v1_message_attempt_count_by_endpoint, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"tag"]" when calling MessageAttemptApi.v1_message_attempt_count_by_endpoint, 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[:'tag'].nil? && opts[:'tag'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"tag\"]' when calling MessageAttemptApi.v1_message_attempt_count_by_endpoint, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/count'.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[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'status_code_class'] = opts[:'status_code_class'] if !opts[:'status_code_class'].nil? query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].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] || 'CountOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_attempt_count_by_endpoint", :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#v1_message_attempt_count_by_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete attempt response body # Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content. The message can't be replayed or resent once its payload has been deleted or expired. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param attempt_id [String] The attempt's ID # @param [Hash] opts the optional parameters # @return [nil] def v1_message_attempt_expunge_content(app_id, msg_id, attempt_id, opts = {}) v1_message_attempt_expunge_content_with_http_info(app_id, msg_id, attempt_id, opts) nil end # Delete attempt response body # Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content. The message can't be replayed or resent once its payload has been deleted or expired. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param attempt_id [String] The attempt's ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def v1_message_attempt_expunge_content_with_http_info(app_id, msg_id, attempt_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_expunge_content ...' 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.v1_message_attempt_expunge_content" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_expunge_content, 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.v1_message_attempt_expunge_content, 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.v1_message_attempt_expunge_content, 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.v1_message_attempt_expunge_content" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.v1_message_attempt_expunge_content, 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.v1_message_attempt_expunge_content, 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.v1_message_attempt_expunge_content, 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.v1_message_attempt_expunge_content" end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content'.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']) 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 => :"MessageAttemptApi.v1_message_attempt_expunge_content", :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: MessageAttemptApi#v1_message_attempt_expunge_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Attempt # `msg_id`: Use a message id or a message `eventId` # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param attempt_id [String] The attempt's ID # @param [Hash] opts the optional parameters # @return [MessageAttemptOut] def v1_message_attempt_get(app_id, msg_id, attempt_id, opts = {}) data, _status_code, _headers = v1_message_attempt_get_with_http_info(app_id, msg_id, attempt_id, opts) data end # Get Attempt # `msg_id`: Use a message id or a message `eventId` # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param attempt_id [String] The attempt's ID # @param [Hash] opts the optional parameters # @return [Array<(MessageAttemptOut, Integer, Hash)>] MessageAttemptOut data, response status code and response headers def v1_message_attempt_get_with_http_info(app_id, msg_id, attempt_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_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.v1_message_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.v1_message_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.v1_message_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.v1_message_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.v1_message_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.v1_message_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.v1_message_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.v1_message_attempt_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.v1_message_attempt_get" end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}'.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']) 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] || 'MessageAttemptOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_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#v1_message_attempt_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] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param attempt_id [String] The attempt's ID # @param [Hash] opts the optional parameters # @return [MessageAttemptHeadersOut] def v1_message_attempt_get_headers(app_id, msg_id, attempt_id, opts = {}) data, _status_code, _headers = v1_message_attempt_get_headers_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] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param attempt_id [String] The attempt's ID # @param [Hash] opts the optional parameters # @return [Array<(MessageAttemptHeadersOut, Integer, Hash)>] MessageAttemptHeadersOut data, response status code and response headers def v1_message_attempt_get_headers_with_http_info(app_id, msg_id, attempt_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_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 MessageAttemptApi.v1_message_attempt_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 MessageAttemptApi.v1_message_attempt_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 MessageAttemptApi.v1_message_attempt_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 MessageAttemptApi.v1_message_attempt_get_headers, 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.v1_message_attempt_get_headers" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.v1_message_attempt_get_headers, 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.v1_message_attempt_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 && msg_id !~ pattern fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.v1_message_attempt_get_headers, 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.v1_message_attempt_get_headers" 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']) 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] || 'MessageAttemptHeadersOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_attempt_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: MessageAttemptApi#v1_message_attempt_get_headers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Attempted Destinations # List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt. By default, endpoints are listed in ascending order by ID. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg'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 # @return [ListResponseMessageEndpointOut] def v1_message_attempt_list_attempted_destinations(app_id, msg_id, opts = {}) data, _status_code, _headers = v1_message_attempt_list_attempted_destinations_with_http_info(app_id, msg_id, opts) data end # List Attempted Destinations # List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt. By default, endpoints are listed in ascending order by ID. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg'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 # @return [Array<(ListResponseMessageEndpointOut, Integer, Hash)>] ListResponseMessageEndpointOut data, response status code and response headers def v1_message_attempt_list_attempted_destinations_with_http_info(app_id, msg_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_list_attempted_destinations ...' 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.v1_message_attempt_list_attempted_destinations" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_list_attempted_destinations, 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.v1_message_attempt_list_attempted_destinations, 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.v1_message_attempt_list_attempted_destinations, 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.v1_message_attempt_list_attempted_destinations" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.v1_message_attempt_list_attempted_destinations, 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.v1_message_attempt_list_attempted_destinations, 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.v1_message_attempt_list_attempted_destinations, 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.v1_message_attempt_list_attempted_destinations, 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 MessageAttemptApi.v1_message_attempt_list_attempted_destinations, must be greater than or equal to 1.' end # resource path local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/endpoint'.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[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].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] || 'ListResponseMessageEndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_attempt_list_attempted_destinations", :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#v1_message_attempt_list_attempted_destinations\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. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. # @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 [Integer] :limit Limit the number of returned items # @option opts [String] :iterator The iterator returned from a prior invocation # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the message tags # @option opts [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Boolean] :with_content When `true` message payloads are included in the response (default to true) # @option opts [Array] :event_types Filter response based on the event type # @return [ListResponseEndpointMessageOut] def v1_message_attempt_list_attempted_messages(app_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_message_attempt_list_attempted_messages_with_http_info(app_id, endpoint_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. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. # @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 [Integer] :limit Limit the number of returned items # @option opts [String] :iterator The iterator returned from a prior invocation # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the message tags # @option opts [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Boolean] :with_content When `true` message payloads are included in the response (default to true) # @option opts [Array] :event_types Filter response based on the event type # @return [Array<(ListResponseEndpointMessageOut, Integer, Hash)>] ListResponseEndpointMessageOut data, response status code and response headers def v1_message_attempt_list_attempted_messages_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_list_attempted_messages ...' 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.v1_message_attempt_list_attempted_messages" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_list_attempted_messages, 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.v1_message_attempt_list_attempted_messages, 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.v1_message_attempt_list_attempted_messages, 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.v1_message_attempt_list_attempted_messages" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.v1_message_attempt_list_attempted_messages, 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.v1_message_attempt_list_attempted_messages, 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.v1_message_attempt_list_attempted_messages, 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.v1_message_attempt_list_attempted_messages, 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 MessageAttemptApi.v1_message_attempt_list_attempted_messages, must be greater than or equal to 1.' 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.v1_message_attempt_list_attempted_messages, 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.v1_message_attempt_list_attempted_messages, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"tag"]" when calling MessageAttemptApi.v1_message_attempt_list_attempted_messages, 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[:'tag'].nil? && opts[:'tag'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"tag\"]' when calling MessageAttemptApi.v1_message_attempt_list_attempted_messages, must conform to the pattern #{pattern}." end # resource path local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg'.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[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].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? query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].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] || 'ListResponseEndpointMessageOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_attempt_list_attempted_messages", :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#v1_message_attempt_list_attempted_messages\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 Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. # @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 [Integer] :limit Limit the number of returned items # @option opts [String] :iterator The iterator returned from a prior invocation # @option opts [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [StatusCodeClass] :status_code_class Filter response based on the HTTP status code # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Boolean] :with_content When `true` attempt content is included in the response (default to true) # @option opts [Boolean] :with_msg When `true`, the message information is included in the response (default to false) # @option opts [Array] :event_types Filter response based on the event type # @return [ListResponseMessageAttemptOut] def v1_message_attempt_list_by_endpoint(app_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_message_attempt_list_by_endpoint_with_http_info(app_id, endpoint_id, opts) data end # List Attempts By Endpoint # List attempts by endpoint id Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. # @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 [Integer] :limit Limit the number of returned items # @option opts [String] :iterator The iterator returned from a prior invocation # @option opts [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [StatusCodeClass] :status_code_class Filter response based on the HTTP status code # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Boolean] :with_content When `true` attempt content is included in the response (default to true) # @option opts [Boolean] :with_msg When `true`, the message information is included in the response (default to false) # @option opts [Array] :event_types Filter response based on the event type # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers def v1_message_attempt_list_by_endpoint_with_http_info(app_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_list_by_endpoint ...' 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.v1_message_attempt_list_by_endpoint" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint, 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.v1_message_attempt_list_by_endpoint, 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.v1_message_attempt_list_by_endpoint, 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.v1_message_attempt_list_by_endpoint" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint, 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.v1_message_attempt_list_by_endpoint, 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.v1_message_attempt_list_by_endpoint, 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.v1_message_attempt_list_by_endpoint, 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 MessageAttemptApi.v1_message_attempt_list_by_endpoint, must be greater than or equal to 1.' 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.v1_message_attempt_list_by_endpoint, 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.v1_message_attempt_list_by_endpoint, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"tag"]" when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint, 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[:'tag'].nil? && opts[:'tag'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"tag\"]' when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint, 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[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].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[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil? query_params[:'with_msg'] = opts[:'with_msg'] if !opts[:'with_msg'].nil? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].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] || 'ListResponseMessageAttemptOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_attempt_list_by_endpoint", :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#v1_message_attempt_list_by_endpoint\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. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param endpoint_id [String] The ep'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 [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Array] :event_types Filter response based on the event type # @return [ListResponseMessageAttemptEndpointOut] def v1_message_attempt_list_by_endpoint_deprecated(app_id, msg_id, endpoint_id, opts = {}) data, _status_code, _headers = v1_message_attempt_list_by_endpoint_deprecated_with_http_info(app_id, msg_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. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param endpoint_id [String] The ep'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 [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Array] :event_types Filter response based on the event type # @return [Array<(ListResponseMessageAttemptEndpointOut, Integer, Hash)>] ListResponseMessageAttemptEndpointOut data, response status code and response headers def v1_message_attempt_list_by_endpoint_deprecated_with_http_info(app_id, msg_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_list_by_endpoint_deprecated ...' 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.v1_message_attempt_list_by_endpoint_deprecated" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated, 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 MessageAttemptApi.v1_message_attempt_list_by_endpoint_deprecated, must be greater than or equal to 1.' 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.v1_message_attempt_list_by_endpoint_deprecated, 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.v1_message_attempt_list_by_endpoint_deprecated, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"tag"]" when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint_deprecated, 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[:'tag'].nil? && opts[:'tag'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"tag\"]' when calling MessageAttemptApi.v1_message_attempt_list_by_endpoint_deprecated, 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('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_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[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].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? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].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] || 'ListResponseMessageAttemptEndpointOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_attempt_list_by_endpoint_deprecated", :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#v1_message_attempt_list_by_endpoint_deprecated\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. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg'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 [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [StatusCodeClass] :status_code_class Filter response based on the HTTP status code # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [String] :endpoint_id Filter the attempts based on the attempted endpoint # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Boolean] :with_content When `true` attempt content is included in the response (default to true) # @option opts [Array] :event_types Filter response based on the event type # @return [ListResponseMessageAttemptOut] def v1_message_attempt_list_by_msg(app_id, msg_id, opts = {}) data, _status_code, _headers = v1_message_attempt_list_by_msg_with_http_info(app_id, msg_id, opts) data end # List Attempts By Msg # List attempts by message ID. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg'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 [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [StatusCodeClass] :status_code_class Filter response based on the HTTP status code # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [String] :endpoint_id Filter the attempts based on the attempted endpoint # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [Boolean] :with_content When `true` attempt content is included in the response (default to true) # @option opts [Array] :event_types Filter response based on the event type # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers def v1_message_attempt_list_by_msg_with_http_info(app_id, msg_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_list_by_msg ...' 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.v1_message_attempt_list_by_msg" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, 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 MessageAttemptApi.v1_message_attempt_list_by_msg, must be greater than or equal to 1.' 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.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"tag"]" when calling MessageAttemptApi.v1_message_attempt_list_by_msg, 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[:'tag'].nil? && opts[:'tag'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"tag\"]' when calling MessageAttemptApi.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, 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.v1_message_attempt_list_by_msg, 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[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].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[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? query_params[:'endpoint_id'] = opts[:'endpoint_id'] if !opts[:'endpoint_id'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil? query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].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] || 'ListResponseMessageAttemptOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_attempt_list_by_msg", :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#v1_message_attempt_list_by_msg\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. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. `msg_id`: Use a message id or a message `eventId` # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg'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 [String] :endpoint_id Filter the attempts based on the attempted endpoint # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [StatusCodeClass] :status_code_class Filter response based on the HTTP status code # @option opts [Array] :event_types Filter response based on the event type # @return [ListResponseMessageAttemptOut] def v1_message_attempt_list_by_msg_deprecated(app_id, msg_id, opts = {}) data, _status_code, _headers = v1_message_attempt_list_by_msg_deprecated_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. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. `msg_id`: Use a message id or a message `eventId` # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg'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 [String] :endpoint_id Filter the attempts based on the attempted endpoint # @option opts [String] :channel Filter response based on the channel # @option opts [String] :tag Filter response based on the tag # @option opts [MessageStatus] :status Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) # @option opts [Time] :before Only include items created before a certain date # @option opts [Time] :after Only include items created after a certain date # @option opts [StatusCodeClass] :status_code_class Filter response based on the HTTP status code # @option opts [Array] :event_types Filter response based on the event type # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers def v1_message_attempt_list_by_msg_deprecated_with_http_info(app_id, msg_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_list_by_msg_deprecated ...' 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.v1_message_attempt_list_by_msg_deprecated" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, 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 MessageAttemptApi.v1_message_attempt_list_by_msg_deprecated, must be greater than or equal to 1.' 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.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, 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.v1_message_attempt_list_by_msg_deprecated, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'].to_s.length > 128 fail ArgumentError, 'invalid value for "opts[:"tag"]" when calling MessageAttemptApi.v1_message_attempt_list_by_msg_deprecated, 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[:'tag'].nil? && opts[:'tag'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"tag\"]' when calling MessageAttemptApi.v1_message_attempt_list_by_msg_deprecated, 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[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil? query_params[:'endpoint_id'] = opts[:'endpoint_id'] if !opts[:'endpoint_id'].nil? query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].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? 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? # 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] || 'ListResponseMessageAttemptOut' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] new_options = opts.merge( :operation => :"MessageAttemptApi.v1_message_attempt_list_by_msg_deprecated", :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#v1_message_attempt_list_by_msg_deprecated\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 app_id [String] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param endpoint_id [String] The ep's ID or UID # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key The request's idempotency key # @return [nil] def v1_message_attempt_resend(app_id, msg_id, endpoint_id, opts = {}) v1_message_attempt_resend_with_http_info(app_id, msg_id, endpoint_id, opts) nil end # Resend Webhook # Resend a message to the specified endpoint. # @param app_id [String] The app's ID or UID # @param msg_id [String] The msg's ID or UID # @param endpoint_id [String] The ep's ID or UID # @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_message_attempt_resend_with_http_info(app_id, msg_id, endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessageAttemptApi.v1_message_attempt_resend ...' 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.v1_message_attempt_resend" end if @api_client.config.client_side_validation && app_id.to_s.length > 256 fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.v1_message_attempt_resend, 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.v1_message_attempt_resend, 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.v1_message_attempt_resend, 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.v1_message_attempt_resend" end if @api_client.config.client_side_validation && msg_id.to_s.length > 256 fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.v1_message_attempt_resend, 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.v1_message_attempt_resend, 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.v1_message_attempt_resend, 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.v1_message_attempt_resend" end if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256 fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.v1_message_attempt_resend, 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.v1_message_attempt_resend, 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.v1_message_attempt_resend, 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('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_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'] 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.v1_message_attempt_resend", :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#v1_message_attempt_resend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end