googleapis / googleapis/google-cloud-node

Secret Manager doesn't tell me which parameters are required

Open
#7,794 2 comments 0 reactions 0 assignees View on GitHub
library: google-cloud-node-core priority: p2 type: feature request
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

Looking at this ol favorite:

```ts
const sm = new SecretManagerServiceClient();
const [secrets] = await sm.listSecrets({
parent: 'projects/el-gato',
});
```

Looking at the `listSecrets` method, I see it takes an options bag. Great! I dig deeper:

```ts
listSecrets(request: protos.google.cloud.secretmanager.v1.IListSecretsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.secretmanager.v1.ISecret[], protos.google.cloud.secretmanager.v1.IListSecretsRequest | null, protos.google.cloud.secretmanager.v1.IListSecretsResponse]>;
```

Ok, fine, what does `IListSecretsRequest` look like:

```ts
/** Properties of a ListSecretsRequest. */
interface IListSecretsRequest {

/** ListSecretsRequest parent */
parent?: (string|null);

/** ListSecretsRequest pageSize */
pageSize?: (number|null);

/** ListSecretsRequest pageToken */
pageToken?: (string|null);
}
```

This has 2 separate problems:

1. I have no idea which of these parameters are required. I know that when I ran my code without it, I got an exception for not passing a `parent` :)

2. I have no idea what any of these properties mean (I mean I do, but a mortal wouldn't). Aren't there better descriptions somewhere for these properties in the protos?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.