Storage/src/StorageObject.php
public function update(array $metadata, array $options = [])
    {
        $options += $metadata;

        // can only set predefinedAcl or acl
        if (isset($options['predefinedAcl'])) {
            $options['acl'] = null;
        }

        return $this->info = $this->connection->patchObject($options + array_filter($this->identity));
    }
public function update(array $metadata, array $options = [])
    {
        $options += $metadata;

        // can only set predefinedAcl or acl
        if (isset($options['predefinedAcl'])) {
            $options['acl'] = null;
        }

        return $this->info = $this->connection->patchObject($options + array_filter($this->identity));
    }
public function update ( array $ metadata , array $ options = [ ] ) { $ options += $ metadata ; // can only set predefinedAcl or acl if ( isset ( $ options [ 'predefinedAcl' ] ) ) { $ options [ 'acl' ] = null ; } return $ this -> info = $ this -> connection -> patchObject ( $ options + array_filter ( $ this -> identity ) ) ; }
Update the object. Upon receiving a result the local object's data will
be updated.

Example:
```
// Add custom metadata to an existing object.
$object->update([
'metadata' => [
'albumType' => 'family'
]
]);
```

@see https://cloud.google.com/storage/docs/json_api/v1/objects/patch Objects patch API documentation.

@param array $metadata The available options for metadata are outlined
at the [JSON API docs](https://cloud.google.com/storage/docs/json_api/v1/objects#resource)
@param array $options [optional] {
Configuration options.

@type string $ifGenerationMatch Makes the operation conditional on
whether the object's current generation matches the given
value.
@type string $ifGenerationNotMatch Makes the operation conditional on
whether the object's current generation does not match the
given value.
@type string $ifMetagenerationMatch Makes the operation conditional
on whether the object's current metageneration matches the
given value.
@type string $ifMetagenerationNotMatch Makes the operation
conditional on whether the object's current metageneration does
not match the given value.
@type string $predefinedAcl Predefined ACL to apply to the object.
Acceptable values include, `"authenticatedRead"`,
`"bucketOwnerFullControl"`, `"bucketOwnerRead"`, `"private"`,
`"projectPrivate"`, and `"publicRead"`.
@type string $projection Determines which properties to return. May
be either 'full' or 'noAcl'.
@type string $fields Selector which will cause the response to only
return the specified fields.
}
@return array
Update the object . Upon receiving a result the local object s data will be updated .