Skip to content

storage.key.Key: add direct support for additional resource fields  #313

@tseaver

Description

@tseaver

The Object API resource representation defines a number of fields as "writable":

  • acl[]
  • cacheControl
  • contentDisposition
  • contentEncoding
  • contentLanguage
  • contentType
  • crc32c
  • md5Hash
  • metadata{}
  • name

Key.from_dict currently captures them all in the key's metadata attribute, but that name creates confusion with its metadata key (which stores application-defined key-value pairs).

I think it would be cleaner to map each the non-user-defined fields onto separate attributes, and propagate them to the server via the insert, and patch or update endpoints.

Key should also expose read-only properties for the non-writable resource fields not already mapped, and which aren't constants:

  • componentCount
  • etag
  • generation
  • id
  • mediaLink
  • metageneration
  • owner{}
  • selfLink
  • size
  • storageClass
  • timeDeleted
  • updated

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions