@media_upload = reference if reference.kind_of?(ResumableUpload)
end
+ # @return [Google::APIClient::Request] Original request object
attr_reader :request
+ # @return [Faraday::Response] HTTP response
attr_reader :response
+ # @!attribute [r] reference
+ # @return [Google::APIClient::Request] Original request object
+ # @deprecated See {#request}
alias_method :reference, :request # For compatibility with pre-beta clients
# @!attribute [r] status
- # @return [Integer] HTTP status code
+ # @return [Fixnum] HTTP status code
# @!attribute [r] headers
# @return [Hash] HTTP response headers
# @!attribute [r] body
# @return [String] HTTP response body
def_delegators :@response, :status, :headers, :body
+ # @!attribute [r] resumable_upload
+ # @return [Google::APIClient::ResumableUpload] For resuming media uploads
def resumable_upload
@media_upload ||= (
options = self.reference.to_hash.merge(
##
# Get the content type of the response
- #
+ # @!attribute [r] media_type
# @return [String]
# Value of content-type header
def media_type
##
# Check if request failed
#
+ # @!attribute [r] error?
# @return [TrueClass, FalseClass]
# true if result of operation is an error
def error?
##
# Check if request was successful
#
+ # @!attribute [r] success?
# @return [TrueClass, FalseClass]
# true if result of operation was successful
def success?
##
# Extracts error messages from the response body
#
+ # @!attribute [r] error_message
# @return [String]
# error message, if available
def error_message
##
# Check for parsable data in response
#
+ # @!attribute [r] data?
# @return [TrueClass, FalseClass]
# true if body can be parsed
def data?
##
# Return parsed version of the response body.
#
+ # @!attribute [r] data
# @return [Object, Hash, String]
# Object if body parsable from API schema, Hash if JSON, raw body if unable to parse
def data
##
# Get the token used for requesting the next page of data
#
+ # @!attribute [r] next_page_token
# @return [String]
# next page token
def next_page_token
##
# Get the token used for requesting the previous page of data
#
+ # @!attribute [r] prev_page_token
# @return [String]
# previous page token
def prev_page_token
)
end
+ ##
+ # Pagination scheme used by this request/response
+ #
+ # @!attribute [r] pagination_type
+ # @return [Symbol]
+ # currently always :token
def pagination_type
return :token
end
+ ##
+ # Name of the field that contains the pagination token
+ #
+ # @!attribute [r] page_token_param
+ # @return [String]
+ # currently always 'pageToken'
def page_token_param
return "pageToken"
end