1 | import { Metadata, ServiceObject } from './nodejs-common';
|
2 | import { Storage } from './storage';
|
3 | export interface HmacKeyOptions {
|
4 | projectId?: string;
|
5 | }
|
6 | export interface HmacKeyMetadata {
|
7 | accessId: string;
|
8 | etag?: string;
|
9 | id?: string;
|
10 | projectId?: string;
|
11 | serviceAccountEmail?: string;
|
12 | state?: string;
|
13 | timeCreated?: string;
|
14 | updated?: string;
|
15 | }
|
16 | export interface SetHmacKeyMetadataOptions {
|
17 | /**
|
18 | * This parameter is currently ignored.
|
19 | */
|
20 | userProject?: string;
|
21 | }
|
22 | export interface SetHmacKeyMetadata {
|
23 | state?: 'ACTIVE' | 'INACTIVE';
|
24 | etag?: string;
|
25 | }
|
26 | export interface HmacKeyMetadataCallback {
|
27 | (err: Error | null, metadata?: HmacKeyMetadata, apiResponse?: Metadata): void;
|
28 | }
|
29 | export declare type HmacKeyMetadataResponse = [HmacKeyMetadata, Metadata];
|
30 | /**
|
31 | * The API-formatted resource description of the HMAC key.
|
32 | *
|
33 | * Note: This is not guaranteed to be up-to-date when accessed. To get the
|
34 | * latest record, call the `getMetadata()` method.
|
35 | *
|
36 | * @name HmacKey#metadata
|
37 | * @type {object}
|
38 | */
|
39 | /**
|
40 | * An HmacKey object contains metadata of an HMAC key created from a
|
41 | * service account through the {@link Storage} client using
|
42 | * {@link Storage#createHmacKey}.
|
43 | *
|
44 | * See {@link https://cloud.google.com/storage/docs/authentication/hmackeys| HMAC keys documentation}
|
45 | *
|
46 | * @class
|
47 | */
|
48 | export declare class HmacKey extends ServiceObject<HmacKeyMetadata | undefined> {
|
49 | metadata: HmacKeyMetadata | undefined;
|
50 | /**
|
51 | * @typedef {object} HmacKeyOptions
|
52 | * @property {string} [projectId] The project ID of the project that owns
|
53 | * the service account of the requested HMAC key. If not provided,
|
54 | * the project ID used to instantiate the Storage client will be used.
|
55 | */
|
56 | /**
|
57 | * Constructs an HmacKey object.
|
58 | *
|
59 | * Note: this only create a local reference to an HMAC key, to create
|
60 | * an HMAC key, use {@link Storage#createHmacKey}.
|
61 | *
|
62 | * @param {Storage} storage The Storage instance this HMAC key is
|
63 | * attached to.
|
64 | * @param {string} accessId The unique accessId for this HMAC key.
|
65 | * @param {HmacKeyOptions} options Constructor configurations.
|
66 | * @example
|
67 | * ```
|
68 | * const {Storage} = require('@google-cloud/storage');
|
69 | * const storage = new Storage();
|
70 | * const hmacKey = storage.hmacKey('access-id');
|
71 | * ```
|
72 | */
|
73 | constructor(storage: Storage, accessId: string, options?: HmacKeyOptions);
|
74 | }
|