Class HmacKey (7.16.0)

An HmacKey object contains metadata of an HMAC key created from a service account through the client using .

See HMAC keys documentation

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
Name
Description
storage
Storage_2

The Storage instance this HMAC key is attached to.

accessId
string

The unique accessId for this HMAC key.

options
HmacKeyOptions

Constructor configurations.

Example
  const 
  
 { 
 Storage 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/storage 
' 
 ); 
 const 
  
 storage 
  
 = 
  
 new 
  
 Storage 
 (); 
 const 
  
 hmacKey 
  
 = 
  
 storage 
 . 
  hmacKey 
 
 ( 
 'access-id' 
 ); 
 

Properties

storage

  storage 
 : 
  
 Storage 
 ; 
 

A reference to the associated with this HmacKey instance. HmacKey#storage {Storage}

Methods

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

Set the metadata for this object.

Parameters
Name
Description
metadata
HmacKeyMetadata

The metadata to set on this object.

options
SetMetadataOptions

Configuration options.

Returns
Type
Description
Promise < SetMetadataResponse < HmacKeyMetadata >>
  setMetadata 
 ( 
 metadata 
 : 
  
 HmacKeyMetadata 
 , 
  
 callback 
 : 
  
 MetadataCallback<HmacKeyMetadata> 
 ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
metadata
callback
MetadataCallback < HmacKeyMetadata >
Returns
Type
Description
void
  setMetadata 
 ( 
 metadata 
 : 
  
 HmacKeyMetadata 
 , 
  
 options 
 : 
  
 SetMetadataOptions 
 , 
  
 callback 
 : 
  
 MetadataCallback<HmacKeyMetadata> 
 ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
metadata
options
SetMetadataOptions
callback
MetadataCallback < HmacKeyMetadata >
Returns
Type
Description
void
Create a Mobile Website
View Site in Mobile | Classic
Share by: