Parent

Google::APIClient::MediaUpload

Media upload elements for discovered methods

Public Class Methods

new(api, method_base, discovery_document) click to toggle source

Creates a description of a particular method.

@param [Google::APIClient::API] api

Base discovery document for the API

@param [Addressable::URI] method_base

The base URI for the service.

@param [Hash] discovery_document

The media upload section of the discovery document.

@return [Google::APIClient::Method] The constructed method object.

# File lib/google/api_client/discovery/media.rb, line 39
def initialize(api, method_base, discovery_document)
  @api = api
  @method_base = method_base
  @discovery_document = discovery_document
end

Public Instance Methods

accepted_types() click to toggle source

List of acceptable mime types

@return [Array]

List of acceptable mime types for uploaded content
# File lib/google/api_client/discovery/media.rb, line 50
def accepted_types
  @discovery_document['accept']
end
max_size() click to toggle source

Maximum size of an uplad TODO: Parse & convert to numeric value

@return [String]

# File lib/google/api_client/discovery/media.rb, line 59
def max_size
  @discovery_document['maxSize']
end
uri_template() click to toggle source

Returns the URI template for the method. A parameter list can be used to expand this into a URI.

@return [Addressable::Template] The URI template.

# File lib/google/api_client/discovery/media.rb, line 68
def uri_template
  return @uri_template ||= Addressable::Template.new(
    @api.method_base.join(Addressable::URI.parse(@discovery_document['protocols']['simple']['path']))
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.