Class: Google::Apis::StorageV1::Object

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

Overview

An object.

Defined Under Namespace

Classes: CustomerEncryption, Owner, Retention

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Object

Returns a new instance of Object.



2521
2522
2523
# File 'lib/google/apis/storage_v1/classes.rb', line 2521

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

Instance Attribute Details

#aclArray<Google::Apis::StorageV1::ObjectAccessControl>

Access controls on the object. Corresponds to the JSON property acl



2299
2300
2301
# File 'lib/google/apis/storage_v1/classes.rb', line 2299

def acl
  @acl
end

#bucketString

The name of the bucket containing this object. Corresponds to the JSON property bucket

Returns:

  • (String)


2304
2305
2306
# File 'lib/google/apis/storage_v1/classes.rb', line 2304

def bucket
  @bucket
end

#cache_controlString

Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600. Corresponds to the JSON property cacheControl

Returns:

  • (String)


2310
2311
2312
# File 'lib/google/apis/storage_v1/classes.rb', line 2310

def cache_control
  @cache_control
end

#component_countFixnum

Number of underlying components that make up this object. Components are accumulated by compose operations. Corresponds to the JSON property componentCount

Returns:

  • (Fixnum)


2316
2317
2318
# File 'lib/google/apis/storage_v1/classes.rb', line 2316

def component_count
  @component_count
end

#content_dispositionString

Content-Disposition of the object data. Corresponds to the JSON property contentDisposition

Returns:

  • (String)


2321
2322
2323
# File 'lib/google/apis/storage_v1/classes.rb', line 2321

def content_disposition
  @content_disposition
end

#content_encodingString

Content-Encoding of the object data. Corresponds to the JSON property contentEncoding

Returns:

  • (String)


2326
2327
2328
# File 'lib/google/apis/storage_v1/classes.rb', line 2326

def content_encoding
  @content_encoding
end

#content_languageString

Content-Language of the object data. Corresponds to the JSON property contentLanguage

Returns:

  • (String)


2331
2332
2333
# File 'lib/google/apis/storage_v1/classes.rb', line 2331

def content_language
  @content_language
end

#content_typeString

Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. Corresponds to the JSON property contentType

Returns:

  • (String)


2337
2338
2339
# File 'lib/google/apis/storage_v1/classes.rb', line 2337

def content_type
  @content_type
end

#crc32cString

CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Data Validation and Change Detection. Corresponds to the JSON property crc32c

Returns:

  • (String)


2345
2346
2347
# File 'lib/google/apis/storage_v1/classes.rb', line 2345

def crc32c
  @crc32c
end

#custom_timeDateTime

A timestamp in RFC 3339 format specified by the user for an object. Corresponds to the JSON property customTime

Returns:

  • (DateTime)


2350
2351
2352
# File 'lib/google/apis/storage_v1/classes.rb', line 2350

def custom_time
  @custom_time
end

#customer_encryptionGoogle::Apis::StorageV1::Object::CustomerEncryption

Metadata of customer-supplied encryption key, if the object is encrypted by such a key. Corresponds to the JSON property customerEncryption



2356
2357
2358
# File 'lib/google/apis/storage_v1/classes.rb', line 2356

def customer_encryption
  @customer_encryption
end

#etagString

HTTP 1.1 Entity tag for the object. Corresponds to the JSON property etag

Returns:

  • (String)


2361
2362
2363
# File 'lib/google/apis/storage_v1/classes.rb', line 2361

def etag
  @etag
end

#event_based_holdBoolean Also known as: event_based_hold?

Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Corresponds to the JSON property eventBasedHold

Returns:

  • (Boolean)


2376
2377
2378
# File 'lib/google/apis/storage_v1/classes.rb', line 2376

def event_based_hold
  @event_based_hold
end

#generationFixnum

The content generation of this object. Used for object versioning. Corresponds to the JSON property generation

Returns:

  • (Fixnum)


2382
2383
2384
# File 'lib/google/apis/storage_v1/classes.rb', line 2382

def generation
  @generation
end

#hard_delete_timeDateTime

This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket. Corresponds to the JSON property hardDeleteTime

Returns:

  • (DateTime)


2389
2390
2391
# File 'lib/google/apis/storage_v1/classes.rb', line 2389

def hard_delete_time
  @hard_delete_time
end

#idString

The ID of the object, including the bucket name, object name, and generation number. Corresponds to the JSON property id

Returns:

  • (String)


2395
2396
2397
# File 'lib/google/apis/storage_v1/classes.rb', line 2395

def id
  @id
end

#kindString

The kind of item this is. For objects, this is always storage#object. Corresponds to the JSON property kind

Returns:

  • (String)


2400
2401
2402
# File 'lib/google/apis/storage_v1/classes.rb', line 2400

def kind
  @kind
end

#kms_key_nameString

Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. Corresponds to the JSON property kmsKeyName

Returns:

  • (String)


2406
2407
2408
# File 'lib/google/apis/storage_v1/classes.rb', line 2406

def kms_key_name
  @kms_key_name
end

#md5_hashString

MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Data Validation and Change Detection. Corresponds to the JSON property md5Hash

Returns:

  • (String)


2413
2414
2415
# File 'lib/google/apis/storage_v1/classes.rb', line 2413

def md5_hash
  @md5_hash
end

Media download link. Corresponds to the JSON property mediaLink

Returns:

  • (String)


2418
2419
2420
# File 'lib/google/apis/storage_v1/classes.rb', line 2418

def media_link
  @media_link
end

#metadataHash<String,String>

User-provided metadata, in key/value pairs. Corresponds to the JSON property metadata

Returns:

  • (Hash<String,String>)


2423
2424
2425
# File 'lib/google/apis/storage_v1/classes.rb', line 2423

def 
  @metadata
end

#metagenerationFixnum

The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. Corresponds to the JSON property metageneration

Returns:

  • (Fixnum)


2431
2432
2433
# File 'lib/google/apis/storage_v1/classes.rb', line 2431

def metageneration
  @metageneration
end

#nameString

The name of the object. Required if not specified by URL parameter. Corresponds to the JSON property name

Returns:

  • (String)


2436
2437
2438
# File 'lib/google/apis/storage_v1/classes.rb', line 2436

def name
  @name
end

#ownerGoogle::Apis::StorageV1::Object::Owner

The owner of the object. This will always be the uploader of the object. Corresponds to the JSON property owner



2441
2442
2443
# File 'lib/google/apis/storage_v1/classes.rb', line 2441

def owner
  @owner
end

#restore_tokenString

Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets. Corresponds to the JSON property restoreToken

Returns:

  • (String)


2448
2449
2450
# File 'lib/google/apis/storage_v1/classes.rb', line 2448

def restore_token
  @restore_token
end

#retentionGoogle::Apis::StorageV1::Object::Retention

A collection of object level retention parameters. Corresponds to the JSON property retention



2453
2454
2455
# File 'lib/google/apis/storage_v1/classes.rb', line 2453

def retention
  @retention
end

#retention_expiration_timeDateTime

A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold). Corresponds to the JSON property retentionExpirationTime

Returns:

  • (DateTime)


2463
2464
2465
# File 'lib/google/apis/storage_v1/classes.rb', line 2463

def retention_expiration_time
  @retention_expiration_time
end

The link to this object. Corresponds to the JSON property selfLink

Returns:

  • (String)


2468
2469
2470
# File 'lib/google/apis/storage_v1/classes.rb', line 2468

def self_link
  @self_link
end

#sizeFixnum

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

Returns:

  • (Fixnum)


2473
2474
2475
# File 'lib/google/apis/storage_v1/classes.rb', line 2473

def size
  @size
end

#soft_delete_timeDateTime

The time at which the object became soft-deleted in RFC 3339 format. Corresponds to the JSON property softDeleteTime

Returns:

  • (DateTime)


2478
2479
2480
# File 'lib/google/apis/storage_v1/classes.rb', line 2478

def soft_delete_time
  @soft_delete_time
end

#storage_classString

Storage class of the object. Corresponds to the JSON property storageClass

Returns:

  • (String)


2483
2484
2485
# File 'lib/google/apis/storage_v1/classes.rb', line 2483

def storage_class
  @storage_class
end

#temporary_holdBoolean Also known as: temporary_hold?

Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object. Corresponds to the JSON property temporaryHold

Returns:

  • (Boolean)


2492
2493
2494
# File 'lib/google/apis/storage_v1/classes.rb', line 2492

def temporary_hold
  @temporary_hold
end

#time_createdDateTime

The creation time of the object in RFC 3339 format. Corresponds to the JSON property timeCreated

Returns:

  • (DateTime)


2498
2499
2500
# File 'lib/google/apis/storage_v1/classes.rb', line 2498

def time_created
  @time_created
end

#time_deletedDateTime

The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. Corresponds to the JSON property timeDeleted

Returns:

  • (DateTime)


2504
2505
2506
# File 'lib/google/apis/storage_v1/classes.rb', line 2504

def time_deleted
  @time_deleted
end

#time_storage_class_updatedDateTime

The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. Corresponds to the JSON property timeStorageClassUpdated

Returns:

  • (DateTime)


2510
2511
2512
# File 'lib/google/apis/storage_v1/classes.rb', line 2510

def time_storage_class_updated
  @time_storage_class_updated
end

#updatedDateTime

The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Corresponds to the JSON property updated

Returns:

  • (DateTime)


2519
2520
2521
# File 'lib/google/apis/storage_v1/classes.rb', line 2519

def updated
  @updated
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
# File 'lib/google/apis/storage_v1/classes.rb', line 2526

def update!(**args)
  @acl = args[:acl] if args.key?(:acl)
  @bucket = args[:bucket] if args.key?(:bucket)
  @cache_control = args[:cache_control] if args.key?(:cache_control)
  @component_count = args[:component_count] if args.key?(:component_count)
  @content_disposition = args[:content_disposition] if args.key?(:content_disposition)
  @content_encoding = args[:content_encoding] if args.key?(:content_encoding)
  @content_language = args[:content_language] if args.key?(:content_language)
  @content_type = args[:content_type] if args.key?(:content_type)
  @crc32c = args[:crc32c] if args.key?(:crc32c)
  @custom_time = args[:custom_time] if args.key?(:custom_time)
  @customer_encryption = args[:customer_encryption] if args.key?(:customer_encryption)
  @etag = args[:etag] if args.key?(:etag)
  @event_based_hold = args[:event_based_hold] if args.key?(:event_based_hold)
  @generation = args[:generation] if args.key?(:generation)
  @hard_delete_time = args[:hard_delete_time] if args.key?(:hard_delete_time)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
  @md5_hash = args[:md5_hash] if args.key?(:md5_hash)
  @media_link = args[:media_link] if args.key?(:media_link)
  @metadata = args[:metadata] if args.key?(:metadata)
  @metageneration = args[:metageneration] if args.key?(:metageneration)
  @name = args[:name] if args.key?(:name)
  @owner = args[:owner] if args.key?(:owner)
  @restore_token = args[:restore_token] if args.key?(:restore_token)
  @retention = args[:retention] if args.key?(:retention)
  @retention_expiration_time = args[:retention_expiration_time] if args.key?(:retention_expiration_time)
  @self_link = args[:self_link] if args.key?(:self_link)
  @size = args[:size] if args.key?(:size)
  @soft_delete_time = args[:soft_delete_time] if args.key?(:soft_delete_time)
  @storage_class = args[:storage_class] if args.key?(:storage_class)
  @temporary_hold = args[:temporary_hold] if args.key?(:temporary_hold)
  @time_created = args[:time_created] if args.key?(:time_created)
  @time_deleted = args[:time_deleted] if args.key?(:time_deleted)
  @time_storage_class_updated = args[:time_storage_class_updated] if args.key?(:time_storage_class_updated)
  @updated = args[:updated] if args.key?(:updated)
end