An HmacKey object contains metadata of an HMAC key created from a service account through the Storage 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
accessId
string
The unique accessId for this HMAC key.
options
HmacKeyOptions
Constructor configurations.
const
{
Storage
}
=
require
(
' @google-cloud/storage
'
);
const
storage
=
new
Storage
();
const
hmacKey
=
storage
.
hmacKey
(
'access-id'
);
Properties
storage
storage
:
Storage
;
Methods
setMetadata(metadata, options)
setMetadata
(
metadata
:
HmacKeyMetadata
,
options
?:
SetMetadataOptions
)
:
Promise<SetMetadataResponse<HmacKeyMetadata>
> ;
Set the metadata for this object.
Parameters
Name
Description
metadata
options
SetMetadataOptions
Configuration options.
setMetadata(metadata, callback)
setMetadata
(
metadata
:
HmacKeyMetadata
,
callback
:
MetadataCallback<HmacKeyMetadata>
)
:
void
;
Returns
Type
Description
void
setMetadata(metadata, options, callback)
setMetadata
(
metadata
:
HmacKeyMetadata
,
options
:
SetMetadataOptions
,
callback
:
MetadataCallback<HmacKeyMetadata>
)
:
void
;
Parameters
Name
Description
metadata
options
SetMetadataOptions
callback
MetadataCallback
< HmacKeyMetadata
>
Returns
Type
Description
void