PutMetadata

Describes options for object metadata update.

JSON representation
{
  "customMetadata": {
    string: string,
    ...
  },
  "contentDisposition": string,
  "contentEncoding": string,
  "contentLanguage": string,
  "contentType": string,
  "cacheControl": string,
  "customTime": string,
  "objectRetention": {
    object (ObjectRetention)
  }
}
Fields
customMetadata

map (key: string, value: string)

Optional. Updates the object's custom metadata. This operation adds or sets individual custom metadata key-value pairs. Keys specified with empty values have their values cleared. Existing custom metadata keys not included in the request remain unchanged. For details, see Custom metadata.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

contentDisposition

string

Optional. Updates objects Content-Disposition fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. For details, see Content-Disposition.

contentEncoding

string

Optional. Updates the objects Content-Encoding fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. For details, see Content-Encoding.

contentLanguage

string

Optional. Updates the objects Content-Language fixed metadata. Metadata values must use ISO 639-1 language codes. The maximum length for metadata values is 100 characters. Unset values in the request are ignored. To clear the metadata, set an empty value. For details, see Content-Language.

contentType

string

Optional. Updates objects Content-Type fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. For details, see Content-Type.

cacheControl

string

Optional. Updates the objects Cache-Control fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. Additionally, the value for Custom-Time can't decrease. For details, see Cache-Control.

customTime

string

Optional. Updates the objects Custom-Time fixed metadata. Unset values in the request are ignored. To clear the metadata, set an empty value. The time must be specified in RFC 3339 format, for example YYYY-MM-DD'T'HH:MM:SS'Z' or YYYY-MM-DD'T'HH:MM:SS.SS'Z'. For details, see Custom-Time.

objectRetention

object (ObjectRetention)

Optional. Updates an object's retention configuration. To clear an object's retention, both retentionMode and retainUntilTime must be left unset (omitted). Setting retentionMode to RETENTION_MODE_UNSPECIFIED is treated as a no-op. Unlike an unset field, it doesn't modify or clear the retention settings. An object with LOCKED retention mode can't have its retention cleared or its retainUntilTime reduced. For more information, see Object retention.

ObjectRetention

Describes options for object retention update.

JSON representation
{
  "retainUntilTime": string,
  "retentionMode": enum (RetentionMode)
}
Fields
retainUntilTime

string

Required. The object's retention expiration time, during which, the object is protected from being deleted or overwritten. The time must be specified in RFC 3339 format, for example YYYY-MM-DD'T'HH:MM:SS'Z' or YYYY-MM-DD'T'HH:MM:SS.SS'Z'. To clear an object's retention, both retentionMode and retainUntilTime must be left unset (omitted). Setting retentionMode to RETENTION_MODE_UNSPECIFIED is treated as a no-op. Unlike an unset field, it doesn't modify or clear the retention settings.

retentionMode

enum (RetentionMode)

Required. The retention mode.

RetentionMode

The retention mode.

Enums
RETENTION_MODE_UNSPECIFIED The retention mode isn't specified.
LOCKED When the retention mode is LOCKED, the retainUntilTime can't be removed or reduced.
UNLOCKED When the retention mode is UNLOCKED, the retainUntilTime can be removed or modified.