# frozen_string_literal: true # This file was auto-generated by lib/tasks/api.rake module Usps module Api module Endpoints module EVSICancel # The eVS # International Cancel request allows an eVS label to be removed from processing # if the request is made prior to 11:59 PM Central Time on the day of label creation.This functionality is # available only if the eVS International label has been held for manifest (i.e. # =”Y” is included in eVS International # label XML request) and the Shipping Services File v2.0 has not yet been # created. Depending on customer profile setup, this transmission could occur for # created labels every 15 minutes, at the end of the shipping day, or when a SCAN # Form is manually triggered by the customer. # @param [Hash] options # @option options [required, Hash] e_vsi_cancel_request # * *:barcode_number* (required, ) — BarcodeNumber of original label. Length of 22, 30 or 34 numbers. # * *:e_vsi_cancel_request* (required, ) — def e_vsi_cancel(options = {}) throw ArgumentError.new('Required arguments :e_vsi_cancel_request missing') if options[:e_vsi_cancel_request].nil? throw ArgumentError.new('Required arguments :e_vsi_cancel_request, :barcode_number missing') if options[:e_vsi_cancel_request][:barcode_number].nil? throw ArgumentError.new('Required arguments :e_vsi_cancel_request, :e_vsi_cancel_request missing') if options[:e_vsi_cancel_request][:e_vsi_cancel_request].nil? request = build_request(:e_vsi_cancel, options) get('https://secure.shippingapis.com/ShippingAPI.dll', { API: 'eVSICancel', XML: request, }) end private def tag_unless_blank(xml, tag_name, data) xml.tag!(tag_name, data) unless data.blank? || data.nil? end def build_e_vsi_cancel_request(xml, options = {}) xml.tag!('BarcodeNumber', options[:e_vsi_cancel_request][:barcode_number]) xml.tag!('eVSICancelRequest', options[:e_vsi_cancel_request][:e_vsi_cancel_request]) xml.target! end end end end end