Skip to content

Commit 2e905b0

Browse files
authored
Merge branch 'main' into v1.5749.0
2 parents 0cb5bfc + 300c837 commit 2e905b0

File tree

6 files changed

+69
-18
lines changed

6 files changed

+69
-18
lines changed

packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,5 +698,6 @@ export const marshalUpdateUserRequest = (
698698
request: UpdateUserRequest,
699699
defaults: DefaultValues,
700700
): Record<string, unknown> => ({
701+
email: request.email,
701702
tags: request.tags,
702703
})

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,4 +1100,6 @@ export type UpdateUserRequest = {
11001100
userId: string
11011101
/** New tags for the user (maximum of 10 tags). */
11021102
tags?: string[]
1103+
/** New email for the user (only available on Members). */
1104+
email?: string
11031105
}

packages/clients/src/api/instance/v1/types.gen.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,11 @@ export interface Dashboard {
639639
securityGroupsCount: number
640640
ipsUnused: number
641641
volumesLSsdCount: number
642-
volumesBSsdCount: number
642+
/** @deprecated */
643+
volumesBSsdCount?: number
643644
volumesLSsdTotalSize: number
644-
volumesBSsdTotalSize: number
645+
/** @deprecated */
646+
volumesBSsdTotalSize?: number
645647
privateNicsCount: number
646648
placementGroupsCount: number
647649
}

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
SNAPSHOT_TRANSIENT_STATUSES,
1414
} from './content.gen'
1515
import {
16+
marshalCreateEndpointRequest,
1617
marshalCreateInstanceRequest,
1718
marshalCreateSnapshotRequest,
1819
marshalCreateUserRequest,
@@ -21,6 +22,7 @@ import {
2122
marshalUpdateSnapshotRequest,
2223
marshalUpdateUserRequest,
2324
marshalUpgradeInstanceRequest,
25+
unmarshalEndpoint,
2426
unmarshalInstance,
2527
unmarshalListInstancesResponse,
2628
unmarshalListNodeTypesResponse,
@@ -31,12 +33,14 @@ import {
3133
unmarshalUser,
3234
} from './marshalling.gen'
3335
import type {
36+
CreateEndpointRequest,
3437
CreateInstanceRequest,
3538
CreateSnapshotRequest,
3639
CreateUserRequest,
3740
DeleteEndpointRequest,
3841
DeleteInstanceRequest,
3942
DeleteSnapshotRequest,
43+
Endpoint,
4044
GetInstanceCertificateRequest,
4145
GetInstanceRequest,
4246
GetSnapshotRequest,
@@ -536,4 +540,25 @@ export class API extends ParentAPI {
536540
method: 'DELETE',
537541
path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`,
538542
})
543+
544+
/**
545+
* Create a new Instance endpoint. Create a new endpoint for a MongoDB®
546+
* Database Instance. You can add `public_network` or `private_network`
547+
* specifications to the body of the request.
548+
*
549+
* @param request - The request {@link CreateEndpointRequest}
550+
* @returns A Promise of Endpoint
551+
*/
552+
createEndpoint = (request: Readonly<CreateEndpointRequest>) =>
553+
this.client.fetch<Endpoint>(
554+
{
555+
body: JSON.stringify(
556+
marshalCreateEndpointRequest(request, this.client.settings),
557+
),
558+
headers: jsonContentHeaders,
559+
method: 'POST',
560+
path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints`,
561+
},
562+
unmarshalEndpoint,
563+
)
539564
}

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

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '../../../bridge'
1010
import type { DefaultValues } from '../../../bridge'
1111
import type {
12+
CreateEndpointRequest,
1213
CreateInstanceRequest,
1314
CreateInstanceRequestVolumeDetails,
1415
CreateSnapshotRequest,
@@ -68,7 +69,7 @@ const unmarshalEndpointPublicDetails = (
6869
return {} as EndpointPublicDetails
6970
}
7071

71-
const unmarshalEndpoint = (data: unknown): Endpoint => {
72+
export const unmarshalEndpoint = (data: unknown): Endpoint => {
7273
if (!isJSONObject(data)) {
7374
throw new TypeError(
7475
`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`,
@@ -353,14 +354,6 @@ const marshalEndpointSpecPublicDetails = (
353354
defaults: DefaultValues,
354355
): Record<string, unknown> => ({})
355356

356-
const marshalCreateInstanceRequestVolumeDetails = (
357-
request: CreateInstanceRequestVolumeDetails,
358-
defaults: DefaultValues,
359-
): Record<string, unknown> => ({
360-
volume_size: request.volumeSize,
361-
volume_type: request.volumeType,
362-
})
363-
364357
const marshalEndpointSpec = (
365358
request: EndpointSpec,
366359
defaults: DefaultValues,
@@ -386,6 +379,22 @@ const marshalEndpointSpec = (
386379
]),
387380
})
388381

382+
export const marshalCreateEndpointRequest = (
383+
request: CreateEndpointRequest,
384+
defaults: DefaultValues,
385+
): Record<string, unknown> => ({
386+
endpoint: marshalEndpointSpec(request.endpoint, defaults),
387+
instance_id: request.instanceId,
388+
})
389+
390+
const marshalCreateInstanceRequestVolumeDetails = (
391+
request: CreateInstanceRequestVolumeDetails,
392+
defaults: DefaultValues,
393+
): Record<string, unknown> => ({
394+
volume_size: request.volumeSize,
395+
volume_type: request.volumeType,
396+
})
397+
389398
export const marshalCreateInstanceRequest = (
390399
request: CreateInstanceRequest,
391400
defaults: DefaultValues,

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,20 @@ export interface Setting {
144144
floatMax?: number
145145
}
146146

147-
export interface CreateInstanceRequestVolumeDetails {
148-
/** Volume size. */
149-
volumeSize: number
150-
/** Type of volume where data is stored. */
151-
volumeType: VolumeType
152-
}
153-
154147
export interface EndpointSpec {
155148
/** One-of ('details'): at most one of 'public', 'privateNetwork' could be set. */
156149
public?: EndpointSpecPublicDetails
157150
/** One-of ('details'): at most one of 'public', 'privateNetwork' could be set. */
158151
privateNetwork?: EndpointSpecPrivateNetworkDetails
159152
}
160153

154+
export interface CreateInstanceRequestVolumeDetails {
155+
/** Volume size. */
156+
volumeSize: number
157+
/** Type of volume where data is stored. */
158+
volumeType: VolumeType
159+
}
160+
161161
export interface Instance {
162162
/** UUID of the Database Instance. */
163163
id: string
@@ -258,6 +258,18 @@ export interface RestoreSnapshotRequestVolumeDetails {
258258
volumeType: VolumeType
259259
}
260260

261+
export type CreateEndpointRequest = {
262+
/**
263+
* Region to target. If none is passed will use default region from the
264+
* config.
265+
*/
266+
region?: Region
267+
/** UUID of the Database Instance. */
268+
instanceId: string
269+
/** EndpointSpec used to expose your Database Instance. */
270+
endpoint: EndpointSpec
271+
}
272+
261273
export type CreateInstanceRequest = {
262274
/**
263275
* Region to target. If none is passed will use default region from the

0 commit comments

Comments
 (0)