Skip to content

Commit e680a84

Browse files
authored
Merge branch 'main' into v1.6771.0
2 parents 052328d + 95288dc commit e680a84

File tree

4 files changed

+356
-1
lines changed

4 files changed

+356
-1
lines changed

packages_generated/iam/src/v1alpha1/api.gen.ts

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ import {
1010
import {
1111
marshalAddGroupMemberRequest,
1212
marshalAddGroupMembersRequest,
13+
marshalAddSamlCertificateRequest,
1314
marshalCreateAPIKeyRequest,
1415
marshalCreateApplicationRequest,
1516
marshalCreateGroupRequest,
1617
marshalCreateJWTRequest,
18+
marshalCreateOrganizationSamlRequest,
1719
marshalCreatePolicyRequest,
1820
marshalCreateSSHKeyRequest,
1921
marshalCreateUserRequest,
@@ -26,6 +28,7 @@ import {
2628
marshalUpdateAPIKeyRequest,
2729
marshalUpdateApplicationRequest,
2830
marshalUpdateGroupRequest,
31+
marshalUpdateOrganizationSamlRequest,
2932
marshalUpdateOrganizationSecuritySettingsRequest,
3033
marshalUpdatePolicyRequest,
3134
marshalUpdateSSHKeyRequest,
@@ -51,6 +54,7 @@ import {
5154
unmarshalListQuotaResponse,
5255
unmarshalListRulesResponse,
5356
unmarshalListSSHKeysResponse,
57+
unmarshalListSamlCertificatesResponse,
5458
unmarshalListUsersResponse,
5559
unmarshalLog,
5660
unmarshalMFAOTP,
@@ -59,6 +63,8 @@ import {
5963
unmarshalPolicy,
6064
unmarshalQuotum,
6165
unmarshalSSHKey,
66+
unmarshalSaml,
67+
unmarshalSamlCertificate,
6268
unmarshalSetRulesResponse,
6369
unmarshalUser,
6470
unmarshalValidateUserMFAOTPResponse,
@@ -67,12 +73,14 @@ import type {
6773
APIKey,
6874
AddGroupMemberRequest,
6975
AddGroupMembersRequest,
76+
AddSamlCertificateRequest,
7077
Application,
7178
ClonePolicyRequest,
7279
CreateAPIKeyRequest,
7380
CreateApplicationRequest,
7481
CreateGroupRequest,
7582
CreateJWTRequest,
83+
CreateOrganizationSamlRequest,
7684
CreatePolicyRequest,
7785
CreateSSHKeyRequest,
7886
CreateUserMFAOTPRequest,
@@ -81,8 +89,10 @@ import type {
8189
DeleteApplicationRequest,
8290
DeleteGroupRequest,
8391
DeleteJWTRequest,
92+
DeleteOrganizationSamlRequest,
8493
DeletePolicyRequest,
8594
DeleteSSHKeyRequest,
95+
DeleteSamlCertificateRequest,
8696
DeleteUserMFAOTPRequest,
8797
DeleteUserRequest,
8898
EncodedJWT,
@@ -92,6 +102,7 @@ import type {
92102
GetJWTRequest,
93103
GetLogRequest,
94104
GetOrganizationRequest,
105+
GetOrganizationSamlRequest,
95106
GetOrganizationSecuritySettingsRequest,
96107
GetPolicyRequest,
97108
GetQuotumRequest,
@@ -126,6 +137,8 @@ import type {
126137
ListRulesResponse,
127138
ListSSHKeysRequest,
128139
ListSSHKeysResponse,
140+
ListSamlCertificatesRequest,
141+
ListSamlCertificatesResponse,
129142
ListUsersRequest,
130143
ListUsersResponse,
131144
LockUserRequest,
@@ -139,6 +152,8 @@ import type {
139152
RemoveGroupMemberRequest,
140153
RemoveUserConnectionRequest,
141154
SSHKey,
155+
Saml,
156+
SamlCertificate,
142157
SetGroupMembersRequest,
143158
SetOrganizationAliasRequest,
144159
SetRulesRequest,
@@ -147,6 +162,7 @@ import type {
147162
UpdateAPIKeyRequest,
148163
UpdateApplicationRequest,
149164
UpdateGroupRequest,
165+
UpdateOrganizationSamlRequest,
150166
UpdateOrganizationSecuritySettingsRequest,
151167
UpdatePolicyRequest,
152168
UpdateSSHKeyRequest,
@@ -1389,4 +1405,117 @@ export class API extends ParentAPI {
13891405
method: 'POST',
13901406
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/migrate-guests`,
13911407
})
1408+
1409+
/**
1410+
* Get SAML Identity Provider configuration of an Organization.
1411+
*
1412+
* @param request - The request {@link GetOrganizationSamlRequest}
1413+
* @returns A Promise of Saml
1414+
*/
1415+
getOrganizationSaml = (request: Readonly<GetOrganizationSamlRequest> = {}) =>
1416+
this.client.fetch<Saml>(
1417+
{
1418+
method: 'GET',
1419+
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`,
1420+
},
1421+
unmarshalSaml,
1422+
)
1423+
1424+
/**
1425+
* Create a SAML Identity Provider configuration for an Organization.
1426+
*
1427+
* @param request - The request {@link CreateOrganizationSamlRequest}
1428+
* @returns A Promise of Saml
1429+
*/
1430+
createOrganizationSaml = (request: Readonly<CreateOrganizationSamlRequest>) =>
1431+
this.client.fetch<Saml>(
1432+
{
1433+
body: JSON.stringify(
1434+
marshalCreateOrganizationSamlRequest(request, this.client.settings),
1435+
),
1436+
headers: jsonContentHeaders,
1437+
method: 'POST',
1438+
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`,
1439+
},
1440+
unmarshalSaml,
1441+
)
1442+
1443+
/**
1444+
* Update a SAML Identity Provider configuration for an Organization.
1445+
*
1446+
* @param request - The request {@link UpdateOrganizationSamlRequest}
1447+
* @returns A Promise of Saml
1448+
*/
1449+
updateOrganizationSaml = (
1450+
request: Readonly<UpdateOrganizationSamlRequest> = {},
1451+
) =>
1452+
this.client.fetch<Saml>(
1453+
{
1454+
body: JSON.stringify(
1455+
marshalUpdateOrganizationSamlRequest(request, this.client.settings),
1456+
),
1457+
headers: jsonContentHeaders,
1458+
method: 'PATCH',
1459+
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`,
1460+
},
1461+
unmarshalSaml,
1462+
)
1463+
1464+
/**
1465+
* Delete a SAML Identity Provider configuration for an Organization.
1466+
*
1467+
* @param request - The request {@link DeleteOrganizationSamlRequest}
1468+
*/
1469+
deleteOrganizationSaml = (
1470+
request: Readonly<DeleteOrganizationSamlRequest> = {},
1471+
) =>
1472+
this.client.fetch<void>({
1473+
method: 'DELETE',
1474+
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`,
1475+
})
1476+
1477+
/**
1478+
* List SAML certificates.
1479+
*
1480+
* @param request - The request {@link ListSamlCertificatesRequest}
1481+
* @returns A Promise of ListSamlCertificatesResponse
1482+
*/
1483+
listSamlCertificates = (request: Readonly<ListSamlCertificatesRequest>) =>
1484+
this.client.fetch<ListSamlCertificatesResponse>(
1485+
{
1486+
method: 'GET',
1487+
path: `/iam/v1alpha1/saml/${validatePathParam('samlId', request.samlId)}/certificates`,
1488+
},
1489+
unmarshalListSamlCertificatesResponse,
1490+
)
1491+
1492+
/**
1493+
* Add a SAML certificate.
1494+
*
1495+
* @param request - The request {@link AddSamlCertificateRequest}
1496+
* @returns A Promise of SamlCertificate
1497+
*/
1498+
addSamlCertificate = (request: Readonly<AddSamlCertificateRequest>) =>
1499+
this.client.fetch<SamlCertificate>(
1500+
{
1501+
body: JSON.stringify(
1502+
marshalAddSamlCertificateRequest(request, this.client.settings),
1503+
),
1504+
headers: jsonContentHeaders,
1505+
method: 'POST',
1506+
path: `/iam/v1alpha1/saml/${validatePathParam('samlId', request.samlId)}/certificates`,
1507+
},
1508+
unmarshalSamlCertificate,
1509+
)
1510+
1511+
/**
1512+
* Delete a SAML certificate.
1513+
*
1514+
* @param request - The request {@link DeleteSamlCertificateRequest}
1515+
*/
1516+
deleteSamlCertificate = (request: Readonly<DeleteSamlCertificateRequest>) =>
1517+
this.client.fetch<void>({
1518+
method: 'DELETE',
1519+
path: `/iam/v1alpha1/saml-certificates/${validatePathParam('certificateId', request.certificateId)}`,
1520+
})
13921521
}

packages_generated/iam/src/v1alpha1/marshalling.gen.ts

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
33
import randomName from '@scaleway/random-name'
4+
import type { DefaultValues } from '@scaleway/sdk-client'
45
import {
56
isJSONObject,
67
resolveOneOf,
78
unmarshalArrayOfObject,
89
unmarshalDate,
910
} from '@scaleway/sdk-client'
10-
import type { DefaultValues } from '@scaleway/sdk-client'
1111
import type {
1212
APIKey,
1313
AddGroupMemberRequest,
1414
AddGroupMembersRequest,
15+
AddSamlCertificateRequest,
1516
Application,
1617
Connection,
1718
ConnectionConnectedOrganization,
@@ -20,6 +21,7 @@ import type {
2021
CreateApplicationRequest,
2122
CreateGroupRequest,
2223
CreateJWTRequest,
24+
CreateOrganizationSamlRequest,
2325
CreatePolicyRequest,
2426
CreateSSHKeyRequest,
2527
CreateUserRequest,
@@ -42,6 +44,7 @@ import type {
4244
ListQuotaResponse,
4345
ListRulesResponse,
4446
ListSSHKeysResponse,
47+
ListSamlCertificatesResponse,
4548
ListUsersResponse,
4649
Log,
4750
MFAOTP,
@@ -56,13 +59,16 @@ import type {
5659
Rule,
5760
RuleSpecs,
5861
SSHKey,
62+
Saml,
63+
SamlCertificate,
5964
SetGroupMembersRequest,
6065
SetOrganizationAliasRequest,
6166
SetRulesRequest,
6267
SetRulesResponse,
6368
UpdateAPIKeyRequest,
6469
UpdateApplicationRequest,
6570
UpdateGroupRequest,
71+
UpdateOrganizationSamlRequest,
6672
UpdateOrganizationSecuritySettingsRequest,
6773
UpdatePolicyRequest,
6874
UpdateSSHKeyRequest,
@@ -265,6 +271,22 @@ export const unmarshalSSHKey = (data: unknown): SSHKey => {
265271
} as SSHKey
266272
}
267273

274+
export const unmarshalSamlCertificate = (data: unknown): SamlCertificate => {
275+
if (!isJSONObject(data)) {
276+
throw new TypeError(
277+
`Unmarshalling the type 'SamlCertificate' failed as data isn't a dictionary.`,
278+
)
279+
}
280+
281+
return {
282+
content: data.content,
283+
expiresAt: unmarshalDate(data.expires_at),
284+
id: data.id,
285+
origin: data.origin,
286+
type: data.type,
287+
} as SamlCertificate
288+
}
289+
268290
export const unmarshalUser = (data: unknown): User => {
269291
if (!isJSONObject(data)) {
270292
throw new TypeError(
@@ -601,6 +623,23 @@ export const unmarshalListSSHKeysResponse = (
601623
} as ListSSHKeysResponse
602624
}
603625

626+
export const unmarshalListSamlCertificatesResponse = (
627+
data: unknown,
628+
): ListSamlCertificatesResponse => {
629+
if (!isJSONObject(data)) {
630+
throw new TypeError(
631+
`Unmarshalling the type 'ListSamlCertificatesResponse' failed as data isn't a dictionary.`,
632+
)
633+
}
634+
635+
return {
636+
certificates: unmarshalArrayOfObject(
637+
data.certificates,
638+
unmarshalSamlCertificate,
639+
),
640+
} as ListSamlCertificatesResponse
641+
}
642+
604643
export const unmarshalListUsersResponse = (
605644
data: unknown,
606645
): ListUsersResponse => {
@@ -658,6 +697,20 @@ export const unmarshalOrganizationSecuritySettings = (
658697
} as OrganizationSecuritySettings
659698
}
660699

700+
export const unmarshalSaml = (data: unknown): Saml => {
701+
if (!isJSONObject(data)) {
702+
throw new TypeError(
703+
`Unmarshalling the type 'Saml' failed as data isn't a dictionary.`,
704+
)
705+
}
706+
707+
return {
708+
entityId: data.entity_id,
709+
id: data.id,
710+
singleSignOnUrl: data.single_sign_on_url,
711+
} as Saml
712+
}
713+
661714
export const unmarshalSetRulesResponse = (data: unknown): SetRulesResponse => {
662715
if (!isJSONObject(data)) {
663716
throw new TypeError(
@@ -702,6 +755,14 @@ export const marshalAddGroupMembersRequest = (
702755
user_ids: request.userIds,
703756
})
704757

758+
export const marshalAddSamlCertificateRequest = (
759+
request: AddSamlCertificateRequest,
760+
defaults: DefaultValues,
761+
): Record<string, unknown> => ({
762+
content: request.content,
763+
type: request.type,
764+
})
765+
705766
export const marshalCreateAPIKeyRequest = (
706767
request: CreateAPIKeyRequest,
707768
defaults: DefaultValues,
@@ -743,6 +804,14 @@ export const marshalCreateJWTRequest = (
743804
user_id: request.userId,
744805
})
745806

807+
export const marshalCreateOrganizationSamlRequest = (
808+
request: CreateOrganizationSamlRequest,
809+
defaults: DefaultValues,
810+
): Record<string, unknown> => ({
811+
entity_id: request.entityId,
812+
single_sign_on_url: request.singleSignOnUrl,
813+
})
814+
746815
const marshalRuleSpecs = (
747816
request: RuleSpecs,
748817
defaults: DefaultValues,
@@ -890,6 +959,14 @@ export const marshalUpdateGroupRequest = (
890959
tags: request.tags,
891960
})
892961

962+
export const marshalUpdateOrganizationSamlRequest = (
963+
request: UpdateOrganizationSamlRequest,
964+
defaults: DefaultValues,
965+
): Record<string, unknown> => ({
966+
entity_id: request.entityId,
967+
single_sign_on_url: request.singleSignOnUrl,
968+
})
969+
893970
export const marshalUpdateOrganizationSecuritySettingsRequest = (
894971
request: UpdateOrganizationSecuritySettingsRequest,
895972
defaults: DefaultValues,

0 commit comments

Comments
 (0)