Sha256: 425375eeb07c01ccbe3617030d13044d5609cd0393562b3680a0b3366771e6aa

Contents?: true

Size: 1.49 KB

Versions: 24

Compression:

Stored size: 1.49 KB

Contents

require_relative 'xml_verb'

module Bandwidth 
  module Voice 
    # The Transfer verb is used to transfer the call to another number
    class Transfer
      include XmlVerb

      def to_bxml(xml)
        xml.Transfer(compact_hash({
         'transferCallerId' => transfer_caller_id,
         'callTimeout' => call_timeout,
         'tag' => tag,
         'transferCompleteUrl' => transfer_complete_url,
         'transferCompleteMethod' => transfer_complete_method,
         'username' => username,
         'password' => password,
         'diversionTreatment' => diversion_treatment,
         'diversionReason' => diversion_reason,
         'transferCompleteFallbackUrl' => transfer_complete_fallback_url,
         'transferCompleteFallbackMethod' => transfer_complete_fallback_method,
         'fallbackUsername' => fallback_username,
         'fallbackPassword' => fallback_password
        })) do
          def embedded_xml(xml, property, type)
            if property
              s = if property.is_a?(type)
                  then property
                  else type.new(property)
                  end
              s.to_bxml(xml)
            end
          end
          if not phone_numbers.nil?
            phone_numbers.each do |number|
              embedded_xml(xml, number, PhoneNumber)
            end
          end
          if not sip_uris.nil?
            sip_uris.each do |sip_uri|
              embedded_xml(xml, sip_uri, SipUri)
            end
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
bandwidth-sdk-10.5.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-10.4.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-10.3.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-10.2.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-10.1.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-10.0.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-9.4.1 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-9.4.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-9.3.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-9.2.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-9.1.2 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-9.1.1 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-9.1.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-9.0.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-8.0.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-7.1.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-7.0.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-6.2.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-6.1.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
bandwidth-sdk-6.0.0 lib/bandwidth/voice_lib/bxml/verbs/transfer.rb