Sha256: 8f01390bad77a1364d4f8325b7ac0917ec73023ff769f7e19852187cdbf36215

Contents?: true

Size: 911 Bytes

Versions: 7

Compression:

Stored size: 911 Bytes

Contents

module Vzaar
  module Request
    class LinkUpload < Base
      endpoint "/api/upload/link"
      authenticated true
      http_verb :post
      resource "LinkUpload"

      def xml_body
        <<-XML
          <?xml version="1.0" encoding="UTF-8"?>#{hash_to_xml(json_body)}
        XML
      end

      def json_body
        { "vzaar-api" => {
            link_upload: {
              key: options[:key],
              guid: options[:guid],
              url: options[:url],
              encoding_params: {
                title: options[:title],
                description: options[:description],
                size_id: options[:profile],
                bitrate: options[:bitrate],
                width: options[:width],
                replace_id: options[:replace_id],
                transcoding: options[:transcoding]
              }
            }
          }
        }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vzaar-1.5.0 lib/vzaar/request/link_upload.rb
vzaar-1.4.4 lib/vzaar/request/link_upload.rb
vzaar-1.4.1 lib/vzaar/request/link_upload.rb
vzaar-1.3.1 lib/vzaar/request/link_upload.rb
vzaar-1.3.0 lib/vzaar/request/link_upload.rb
vzaar-1.2.4 lib/vzaar/request/link_upload.rb
vzaar-1.2.3 lib/vzaar/request/link_upload.rb