Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions packages/clients/src/api/secret/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,6 @@ export class API extends ParentAPI {
unmarshalSecret,
)

/**
* Allow another product to use the secret.
*
* @param request - The request {@link AddSecretOwnerRequest}
*/
addSecretOwner = (request: Readonly<AddSecretOwnerRequest>) =>
this.client.fetch<void>({
body: JSON.stringify(
marshalAddSecretOwnerRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'POST',
path: `/secret-manager/v1alpha1/regions/${validatePathParam(
'region',
request.region ?? this.client.settings.defaultRegion,
)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner`,
})

protected pageOfListSecrets = (request: Readonly<ListSecretsRequest> = {}) =>
this.client.fetch<ListSecretsResponse>(
{
Expand Down Expand Up @@ -215,6 +197,24 @@ export class API extends ParentAPI {
)}/secrets/${validatePathParam('secretId', request.secretId)}`,
})

/**
* Allow a product to use the secret.
*
* @param request - The request {@link AddSecretOwnerRequest}
*/
addSecretOwner = (request: Readonly<AddSecretOwnerRequest>) =>
this.client.fetch<void>({
body: JSON.stringify(
marshalAddSecretOwnerRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'POST',
path: `/secret-manager/v1alpha1/regions/${validatePathParam(
'region',
request.region ?? this.client.settings.defaultRegion,
)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner`,
})

/**
* Create a version. Create a version of a given secret specified by the
* `region` and `secret_id` parameters.
Expand Down Expand Up @@ -385,30 +385,6 @@ export class API extends ParentAPI {
request,
)

/**
* Delete a version. Delete a secret's version and the sensitive data
* contained in it. Deleting a version is permanent and cannot be undone.
*
* @param request - The request {@link DestroySecretVersionRequest}
* @returns A Promise of SecretVersion
*/
destroySecretVersion = (request: Readonly<DestroySecretVersionRequest>) =>
this.client.fetch<SecretVersion>(
{
body: '{}',
headers: jsonContentHeaders,
method: 'POST',
path: `/secret-manager/v1alpha1/regions/${validatePathParam(
'region',
request.region ?? this.client.settings.defaultRegion,
)}/secrets/${validatePathParam(
'secretId',
request.secretId,
)}/versions/${validatePathParam('revision', request.revision)}/destroy`,
},
unmarshalSecretVersion,
)

/**
* Enable a version. Make a specific version accessible. You must specify the
* `region`, `secret_id` and `revision` parameters.
Expand Down Expand Up @@ -504,4 +480,28 @@ export class API extends ParentAPI {
},
unmarshalAccessSecretVersionResponse,
)

/**
* Delete a version. Delete a secret's version and the sensitive data
* contained in it. Deleting a version is permanent and cannot be undone.
*
* @param request - The request {@link DestroySecretVersionRequest}
* @returns A Promise of SecretVersion
*/
destroySecretVersion = (request: Readonly<DestroySecretVersionRequest>) =>
this.client.fetch<SecretVersion>(
{
body: '{}',
headers: jsonContentHeaders,
method: 'POST',
path: `/secret-manager/v1alpha1/regions/${validatePathParam(
'region',
request.region ?? this.client.settings.defaultRegion,
)}/secrets/${validatePathParam(
'secretId',
request.secretId,
)}/versions/${validatePathParam('revision', request.revision)}/destroy`,
},
unmarshalSecretVersion,
)
}
100 changes: 50 additions & 50 deletions packages/clients/src/api/secret/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ export interface AccessSecretVersionResponse {
* The CRC32 checksum of the data as a base-10 integer. This field is present
* only if a CRC32 was supplied during the creation of the version.
*/
dataCrc32: number
dataCrc32?: number
}

/** List secret versions response. */
export interface ListSecretVersionsResponse {
/** Number of versions. */
totalCount: number
/** Single page of versions. */
versions: SecretVersion[]
/** Number of versions. */
totalCount: number
}

/** List secrets response. */
export interface ListSecretsResponse {
/** Count of all secrets matching the requested criteria. */
totalCount: number
/** Single page of secrets matching the requested criteria. */
secrets: Secret[]
/** Count of all secrets matching the requested criteria. */
totalCount: number
}

/** Password generation params. */
Expand Down Expand Up @@ -85,40 +85,40 @@ export interface Secret {
updatedAt?: Date
/** List of the secret's tags. */
tags: string[]
/** Region of the secret. */
region: Region
/** Number of versions for this secret. */
versionCount: number
/** Updated description of the secret. */
description?: string
/** True for secrets that are managed by another product. */
isManaged: boolean
/** Region of the secret. */
region: Region
}

/** Secret version. */
export interface SecretVersion {
/** ID of the secret. */
secretId: string
/**
* Version number. The first version of the secret is numbered 1, and all
* subsequent revisions augment by 1.
*/
revision: number
/** ID of the secret. */
secretId: string
/**
* Current status of the version. `unknown`: the version is in an invalid
* state. `enabled`: the version is accessible. `disabled`: the version is not
* accessible but can be enabled. `destroyed`: the version is permanently
* deleted. It is not possible to recover it.
*/
status: SecretVersionStatus
/** True if the version is the latest one. */
isLatest: boolean
/** Date and time of the version's creation. */
createdAt?: Date
/** Last update of the version. */
updatedAt?: Date
/** Description of the version. */
description?: string
/** True if the version is the latest one. */
isLatest: boolean
}

export type CreateSecretRequest = {
Expand Down Expand Up @@ -173,18 +173,6 @@ export type UpdateSecretRequest = {
description?: string
}

export type AddSecretOwnerRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
/** ID of the secret. */
secretId: string
/** Name of the product to add. */
productName: string
}

export type ListSecretsRequest = {
/**
* Region to target. If none is passed will use default region from the
Expand All @@ -195,15 +183,15 @@ export type ListSecretsRequest = {
organizationId?: string
/** Filter by Project ID (optional). */
projectId?: string
/** Filter by secret name (optional). */
name?: string
orderBy?: ListSecretsRequestOrderBy
page?: number
pageSize?: number
/** List of tags to filter on (optional). */
tags?: string[]
/** Filter by secret name (optional). */
name?: string
/** Filter by managed / not managed (optional). */
isManaged?: boolean
orderBy?: ListSecretsRequestOrderBy
page?: number
pageSize?: number
}

export type DeleteSecretRequest = {
Expand All @@ -216,6 +204,18 @@ export type DeleteSecretRequest = {
secretId: string
}

export type AddSecretOwnerRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
/** ID of the secret. */
secretId: string
/** Name of the product to add. */
productName: string
}

export type CreateSecretVersionRequest = {
/**
* Region to target. If none is passed will use default region from the
Expand All @@ -229,28 +229,28 @@ export type CreateSecretVersionRequest = {
/** Description of the version. */
description?: string
/**
* Disable the previous secret version. If there is no previous version or if
* the previous version was already disabled, does nothing.
* Disable the previous secret version. Optional. If there is no previous
* version or if the previous version was already disabled, does nothing.
*/
disablePrevious: boolean
disablePrevious?: boolean
/**
* Options to generate a password. If specified, a random password will be
* generated. The data field must be empty. By default, the generator will use
* upper and lower case letters, and digits. This behavior can be tuned using
* the generation parameters.
* Options to generate a password. Optional. If specified, a random password
* will be generated. The data and data_crc32 fields must be empty. By
* default, the generator will use upper and lower case letters, and digits.
* This behavior can be tuned using the generation parameters.
*
* One-of ('PasswordGeneration'): at most one of 'passwordGeneration' could be
* set.
*/
passwordGeneration?: PasswordGenerationParams
/**
* The CRC32 checksum of the data as a base-10 integer. This field is optional
* and can be set to 0. If greater than 0, the Secret Manager will verify the
* integrity of the data received against the given CRC32. An error is
* returned if the CRC32 does not match. Otherwise, the CRC32 will be stored
* and returned along with the SecretVersion on futur accesses.
* The CRC32 checksum of the data as a base-10 integer. Optional. If
* specified, the Secret Manager will verify the integrity of the data
* received against the given CRC32. An error is returned if the CRC32 does
* not match. Otherwise, the CRC32 will be stored and returned along with the
* SecretVersion on futur accesses.
*/
dataCrc32: number
dataCrc32?: number
}

export type GetSecretVersionRequest = {
Expand Down Expand Up @@ -328,7 +328,7 @@ export type ListSecretVersionsByNameRequest = {
status?: SecretVersionStatus[]
}

export type DestroySecretVersionRequest = {
export type EnableSecretVersionRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
Expand All @@ -343,7 +343,7 @@ export type DestroySecretVersionRequest = {
revision: string
}

export type EnableSecretVersionRequest = {
export type DisableSecretVersionRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
Expand All @@ -358,7 +358,7 @@ export type EnableSecretVersionRequest = {
revision: string
}

export type DisableSecretVersionRequest = {
export type AccessSecretVersionRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
Expand All @@ -373,29 +373,29 @@ export type DisableSecretVersionRequest = {
revision: string
}

export type AccessSecretVersionRequest = {
export type AccessSecretVersionByNameRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
/** ID of the secret. */
secretId: string
/** Name of the secret. */
secretName: string
/**
* Version number. The first version of the secret is numbered 1, and all
* subsequent revisions augment by 1. Value can be a number or "latest".
*/
revision: string
}

export type AccessSecretVersionByNameRequest = {
export type DestroySecretVersionRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
/** Name of the secret. */
secretName: string
/** ID of the secret. */
secretId: string
/**
* Version number. The first version of the secret is numbered 1, and all
* subsequent revisions augment by 1. Value can be a number or "latest".
Expand Down