Skip to content

Commit 0863a00

Browse files
authored
Added support for Enabled Client Connections (#1114)
2 parents c6d4cb4 + 99a46da commit 0863a00

File tree

3 files changed

+292
-3
lines changed

3 files changed

+292
-3
lines changed

src/management/__generated/managers/connections-manager.ts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import type {
44
Connection,
55
ConnectionCreate,
66
ConnectionUpdate,
7+
GetConnectionClients200Response,
78
GetConnections200Response,
89
GetDefaultMapping200Response,
910
GetScimConfiguration200Response,
1011
GetScimTokens200ResponseInner,
12+
PatchClientsRequestInner,
1113
PatchScimConfigurationRequest,
1214
PostScimConfigurationRequest,
1315
PostScimToken201Response,
@@ -18,12 +20,14 @@ import type {
1820
DeleteScimConfigurationRequest,
1921
DeleteTokensByTokenIdRequest,
2022
DeleteUsersByEmailRequest,
23+
GetConnectionClientsRequest,
2124
GetConnectionsRequest,
2225
GetConnectionsByIdRequest,
2326
GetDefaultMappingRequest,
2427
GetScimConfigurationRequest,
2528
GetScimTokensRequest,
2629
GetStatusRequest,
30+
PatchClientsRequest,
2731
PatchConnectionsByIdRequest,
2832
PatchScimConfigurationOperationRequest,
2933
PostScimConfigurationOperationRequest,
@@ -148,6 +152,47 @@ export class ConnectionsManager extends BaseAPI {
148152
return runtime.VoidApiResponse.fromResponse(response);
149153
}
150154

155+
/**
156+
* Retrieve all clients that have the specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> enabled.
157+
*
158+
* <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no further results are remaining.
159+
*
160+
* Get enabled clients for a connection
161+
*
162+
* @throws {RequiredError}
163+
*/
164+
async getEnabledClients(
165+
requestParameters: GetConnectionClientsRequest,
166+
initOverrides?: InitOverride
167+
): Promise<ApiResponse<GetConnectionClients200Response>> {
168+
runtime.validateRequiredRequestParams(requestParameters, ['id']);
169+
170+
const queryParameters = runtime.applyQueryParams(requestParameters, [
171+
{
172+
key: 'take',
173+
config: {},
174+
},
175+
{
176+
key: 'from',
177+
config: {},
178+
},
179+
]);
180+
181+
const response = await this.request(
182+
{
183+
path: `/connections/{id}/clients`.replace(
184+
'{id}',
185+
encodeURIComponent(String(requestParameters.id))
186+
),
187+
method: 'GET',
188+
query: queryParameters,
189+
},
190+
initOverrides
191+
);
192+
193+
return runtime.JSONApiResponse.fromResponse(response);
194+
}
195+
151196
/**
152197
* Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections.
153198
*
@@ -213,6 +258,10 @@ export class ConnectionsManager extends BaseAPI {
213258
isCollectionFormatMulti: true,
214259
},
215260
},
261+
{
262+
key: 'domain_alias',
263+
config: {},
264+
},
216265
{
217266
key: 'name',
218267
config: {},
@@ -381,6 +430,38 @@ export class ConnectionsManager extends BaseAPI {
381430
return runtime.VoidApiResponse.fromResponse(response);
382431
}
383432

433+
/**
434+
* Update enabled clients for a connection
435+
*
436+
* @throws {RequiredError}
437+
*/
438+
async updateEnabledClients(
439+
requestParameters: PatchClientsRequest,
440+
bodyParameters: Array<PatchClientsRequestInner>,
441+
initOverrides?: InitOverride
442+
): Promise<ApiResponse<void>> {
443+
runtime.validateRequiredRequestParams(requestParameters, ['id']);
444+
445+
const headerParameters: runtime.HTTPHeaders = {};
446+
447+
headerParameters['Content-Type'] = 'application/json';
448+
449+
const response = await this.request(
450+
{
451+
path: `/connections/{id}/clients`.replace(
452+
'{id}',
453+
encodeURIComponent(String(requestParameters.id))
454+
),
455+
method: 'PATCH',
456+
headers: headerParameters,
457+
body: bodyParameters,
458+
},
459+
initOverrides
460+
);
461+
462+
return runtime.VoidApiResponse.fromResponse(response);
463+
}
464+
384465
/**
385466
* Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration.
386467
*

src/management/__generated/models/index.ts

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,7 +3058,7 @@ export interface Connection {
30583058
*/
30593059
realms: Array<string>;
30603060
/**
3061-
* The ids of the clients for which the connection is enabled
3061+
* DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled
30623062
*
30633063
*/
30643064
enabled_clients: Array<string>;
@@ -3101,7 +3101,7 @@ export interface ConnectionCreate {
31013101
*/
31023102
options?: ConnectionCreateOptions;
31033103
/**
3104-
* The identifiers of the clients for which the connection is to be enabled. If the array is empty or the property is not specified, no clients are enabled
3104+
* DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.
31053105
*
31063106
*/
31073107
enabled_clients?: Array<string>;
@@ -3542,7 +3542,7 @@ export interface ConnectionUpdate {
35423542
*/
35433543
options?: ConnectionUpdateOptions | null;
35443544
/**
3545-
* The identifiers of the clients for which the connection is to be enabled. If the property is not specified, no clients are enabled. If the array is empty, the connection will be disabled for every client.
3545+
* DEPRECATED property. Use the PATCH /v2/connections/{id}/clients endpoint to enable or disable the connection for any clients.
35463546
*
35473547
*/
35483548
enabled_clients?: Array<string>;
@@ -5535,6 +5535,33 @@ export interface GetClients200ResponseOneOf1 {
55355535
*/
55365536
clients: Array<Client>;
55375537
}
5538+
/**
5539+
*
5540+
*/
5541+
export interface GetConnectionClients200Response {
5542+
[key: string]: any | any;
5543+
/**
5544+
* Clients for which the connection is enabled
5545+
*
5546+
*/
5547+
clients: Array<GetConnectionClients200ResponseClientsInner>;
5548+
/**
5549+
* Encoded next token
5550+
*
5551+
*/
5552+
next?: string;
5553+
}
5554+
/**
5555+
*
5556+
*/
5557+
export interface GetConnectionClients200ResponseClientsInner {
5558+
[key: string]: any | any;
5559+
/**
5560+
* The client id
5561+
*
5562+
*/
5563+
client_id: string;
5564+
}
55385565
/**
55395566
*
55405567
*/
@@ -9690,6 +9717,21 @@ export const PatchClientGrantsByIdRequestOrganizationUsageEnum = {
96909717
export type PatchClientGrantsByIdRequestOrganizationUsageEnum =
96919718
(typeof PatchClientGrantsByIdRequestOrganizationUsageEnum)[keyof typeof PatchClientGrantsByIdRequestOrganizationUsageEnum];
96929719

9720+
/**
9721+
*
9722+
*/
9723+
export interface PatchClientsRequestInner {
9724+
/**
9725+
* The client_id of the client to be the subject to change status
9726+
*
9727+
*/
9728+
client_id: string;
9729+
/**
9730+
* Whether the connection is enabled or not for this client_id
9731+
*
9732+
*/
9733+
status: boolean;
9734+
}
96939735
/**
96949736
*
96959737
*/
@@ -18277,6 +18319,26 @@ export interface DeleteUsersByEmailRequest {
1827718319
*/
1827818320
email: string;
1827918321
}
18322+
/**
18323+
*
18324+
*/
18325+
export interface GetConnectionClientsRequest {
18326+
/**
18327+
* The id of the connection for which enabled clients are to be retrieved
18328+
*
18329+
*/
18330+
id: string;
18331+
/**
18332+
* Number of results per page. Defaults to 50.
18333+
*
18334+
*/
18335+
take?: number;
18336+
/**
18337+
* Optional Id from which to start selection.
18338+
*
18339+
*/
18340+
from?: string;
18341+
}
1828018342

1828118343
/**
1828218344
*
@@ -18382,6 +18444,11 @@ export interface GetConnectionsRequest {
1838218444
*
1838318445
*/
1838418446
strategy?: Array<GetConnectionsStrategyEnum>;
18447+
/**
18448+
* Provide the domain_alias to only retrieve connections with such domain
18449+
*
18450+
*/
18451+
domain_alias?: string;
1838518452
/**
1838618453
* Provide the name of the connection to retrieve
1838718454
*
@@ -18458,6 +18525,16 @@ export interface GetStatusRequest {
1845818525
*/
1845918526
id: string;
1846018527
}
18528+
/**
18529+
*
18530+
*/
18531+
export interface PatchClientsRequest {
18532+
/**
18533+
* The id of the connection to modify
18534+
*
18535+
*/
18536+
id: string;
18537+
}
1846118538
/**
1846218539
*
1846318540
*/

0 commit comments

Comments
 (0)