Class: Google::Apis::StorageV1beta1::Object::Media

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/storage_v1beta1/classes.rb,
generated/google/apis/storage_v1beta1/representations.rb,
generated/google/apis/storage_v1beta1/representations.rb

Overview

Object media data. Provided on your behalf when uploading raw media or multipart/related with an auxiliary media part.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Media

Returns a new instance of Media



423
424
425
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 423

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#algorithmString

Hash algorithm used. Currently only MD5 is supported. Required if a hash is provided. Corresponds to the JSON property algorithm

Returns:

  • (String)


387
388
389
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 387

def algorithm
  @algorithm
end

#content_typeString

Content-Type of the object data. Corresponds to the JSON property contentType

Returns:

  • (String)


392
393
394
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 392

def content_type
  @content_type
end

#dataString

URL-safe Base64-encoded data. This property can be used to insert objects under 64KB in size, and will only be returned in response to the get method for objects so created. When this resource is returned in response to the list method, this property is omitted. Corresponds to the JSON property data NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


401
402
403
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 401

def data
  @data
end

#hash_propString

Hash of the data. Required if a hash algorithm is provided. Corresponds to the JSON property hash

Returns:

  • (String)


406
407
408
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 406

def hash_prop
  @hash_prop
end

#lengthFixnum

Content-Length of the data in bytes. Corresponds to the JSON property length

Returns:

  • (Fixnum)


411
412
413
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 411

def length
  @length
end

Media download link. Corresponds to the JSON property link

Returns:

  • (String)


416
417
418
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 416

def link
  @link
end

#time_createdDateTime

Creation time of the data in RFC 3339 format. Corresponds to the JSON property timeCreated

Returns:

  • (DateTime)


421
422
423
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 421

def time_created
  @time_created
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



428
429
430
431
432
433
434
435
436
# File 'generated/google/apis/storage_v1beta1/classes.rb', line 428

def update!(**args)
  @algorithm = args[:algorithm] if args.key?(:algorithm)
  @content_type = args[:content_type] if args.key?(:content_type)
  @data = args[:data] if args.key?(:data)
  @hash_prop = args[:hash_prop] if args.key?(:hash_prop)
  @length = args[:length] if args.key?(:length)
  @link = args[:link] if args.key?(:link)
  @time_created = args[:time_created] if args.key?(:time_created)
end