Class HmacKey (7.16.0) Stay organized with collections Save and categorize content based on your preferences.
An HmacKey object contains metadata of an HMAC key created from a service account through the client using .
Package
@google-cloud/storageConstructors
(constructor)(storage, accessId, options)
constructor(storage:Storage,accessId:string,options?:HmacKeyOptions);Constructs an HmacKey object.
Note: this only create a local reference to an HMAC key, to create an HMAC key, use .
| Parameters | |
|---|---|
| Name | Description |
storage | Storage_2The Storage instance this HMAC key is attached to. |
accessId | stringThe unique accessId for this HMAC key. |
options | HmacKeyOptionsConstructor configurations. |
const{Storage}=require('@google-cloud/storage');conststorage=newStorage();consthmacKey=storage.hmacKey('access-id');Properties
storage
storage:Storage;A reference to the associated with thisHmacKey instance. HmacKey#storage {Storage}
Methods
setMetadata(metadata, options)
setMetadata(metadata:HmacKeyMetadata,options?:SetMetadataOptions):Promise<SetMetadataResponse<HmacKeyMetadata>>;Set the metadata for this object.
| Parameters | |
|---|---|
| Name | Description |
metadata | HmacKeyMetadataThe metadata to set on this object. |
options | SetMetadataOptionsConfiguration options. |
| Returns | |
|---|---|
| Type | Description |
Promise<SetMetadataResponse<HmacKeyMetadata>> | |
setMetadata(metadata, callback)
setMetadata(metadata:HmacKeyMetadata,callback:MetadataCallback<HmacKeyMetadata>):void;| Parameters | |
|---|---|
| Name | Description |
metadata | HmacKeyMetadata |
callback | MetadataCallback<HmacKeyMetadata> |
| Returns | |
|---|---|
| Type | Description |
void | |
setMetadata(metadata, options, callback)
setMetadata(metadata:HmacKeyMetadata,options:SetMetadataOptions,callback:MetadataCallback<HmacKeyMetadata>):void;| Parameters | |
|---|---|
| Name | Description |
metadata | HmacKeyMetadata |
options | SetMetadataOptions |
callback | MetadataCallback<HmacKeyMetadata> |
| Returns | |
|---|---|
| Type | Description |
void | |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.