Skip to content

Commit 2738abe

Browse files
feat(mongodb): add deleteUser route (#1700)
Co-authored-by: philibeaux <[email protected]>
1 parent 506a671 commit 2738abe

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

packages/clients/src/api/mongodb/v1alpha1/api.gen.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import type {
4040
DeleteEndpointRequest,
4141
DeleteInstanceRequest,
4242
DeleteSnapshotRequest,
43+
DeleteUserRequest,
4344
Endpoint,
4445
GetInstanceCertificateRequest,
4546
GetInstanceRequest,
@@ -527,6 +528,20 @@ export class API extends ParentAPI {
527528
unmarshalUser,
528529
)
529530

531+
/**
532+
* Delete a user on a Database Instance. Delete an existing user on a Database
533+
* Instance.
534+
*
535+
* @param request - The request {@link DeleteUserRequest}
536+
*/
537+
deleteUser = (request: Readonly<DeleteUserRequest>) =>
538+
this.client.fetch<void>({
539+
body: '{}',
540+
headers: jsonContentHeaders,
541+
method: 'DELETE',
542+
path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`,
543+
})
544+
530545
/**
531546
* Delete a Database Instance endpoint. Delete the endpoint of a Database
532547
* Instance. You must specify the `endpoint_id` parameter of the endpoint you

packages/clients/src/api/mongodb/v1alpha1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type {
1111
DeleteEndpointRequest,
1212
DeleteInstanceRequest,
1313
DeleteSnapshotRequest,
14+
DeleteUserRequest,
1415
Endpoint,
1516
EndpointPrivateNetworkDetails,
1617
EndpointPublicDetails,

packages/clients/src/api/mongodb/v1alpha1/types.gen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,18 @@ export type DeleteSnapshotRequest = {
356356
snapshotId: string
357357
}
358358

359+
export type DeleteUserRequest = {
360+
/**
361+
* Region to target. If none is passed will use default region from the
362+
* config.
363+
*/
364+
region?: Region
365+
/** UUID of the Database Instance the user belongs to. */
366+
instanceId: string
367+
/** Name of the database user. */
368+
name: string
369+
}
370+
359371
export type GetInstanceCertificateRequest = {
360372
/**
361373
* Region to target. If none is passed will use default region from the

packages/clients/src/api/mongodb/v1alpha1/validation-rules.gen.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ export const CreateUserRequest = {
5050
},
5151
}
5252

53+
export const DeleteUserRequest = {
54+
name: {
55+
maxLength: 63,
56+
minLength: 1,
57+
pattern: /^[a-zA-Z0-9_\-]*$/,
58+
},
59+
}
60+
5361
export const ListInstancesRequest = {
5462
name: {
5563
maxLength: 255,

0 commit comments

Comments
 (0)