Class HmacKey (7.16.0)

Inheritance

ServiceObject<HmacKey,HmacKeyMetadata> >HmacKey

Package

@google-cloud/storage

Constructors

(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
NameDescription
storageStorage_2

The Storage instance this HMAC key is attached to.

accessIdstring

The unique accessId for this HMAC key.

optionsHmacKeyOptions

Constructor configurations.

Example
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
NameDescription
metadataHmacKeyMetadata

The metadata to set on this object.

optionsSetMetadataOptions

Configuration options.

Returns
TypeDescription
Promise<SetMetadataResponse<HmacKeyMetadata>>

setMetadata(metadata, callback)

setMetadata(metadata:HmacKeyMetadata,callback:MetadataCallback<HmacKeyMetadata>):void;
Parameters
NameDescription
metadataHmacKeyMetadata
callbackMetadataCallback<HmacKeyMetadata>
Returns
TypeDescription
void

setMetadata(metadata, options, callback)

setMetadata(metadata:HmacKeyMetadata,options:SetMetadataOptions,callback:MetadataCallback<HmacKeyMetadata>):void;
Parameters
NameDescription
metadataHmacKeyMetadata
optionsSetMetadataOptions
callbackMetadataCallback<HmacKeyMetadata>
Returns
TypeDescription
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.