Class HmacKey (6.7.0)

Inheritance

ServiceObject<HmacKeyMetadata | undefined> >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

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

metadata

metadata:HmacKeyMetadata|undefined;

storage

storage:Storage;

A reference to theStorage associated with thisHmacKey instance. HmacKey#storage {Storage}

Methods

setMetadata(metadata, options)

setMetadata(metadata:Metadata,options?:SetMetadataOptions):Promise<SetMetadataResponse>;

Set the metadata for this object.

Parameters
NameDescription
metadataMetadata

The metadata to set on this object.

optionsSetMetadataOptions

Configuration options.

Returns
TypeDescription
Promise<SetMetadataResponse>

setMetadata(metadata, callback)

setMetadata(metadata:Metadata,callback:MetadataCallback):void;
Parameters
NameDescription
metadataMetadata
callbackMetadataCallback
Returns
TypeDescription
void

setMetadata(metadata, options, callback)

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